diff --git a/bootstrap/bootstrap.php b/bootstrap/bootstrap.php index 95ce2c5..3a34fe8 100644 --- a/bootstrap/bootstrap.php +++ b/bootstrap/bootstrap.php @@ -17,7 +17,7 @@ public function run() $this->settings = include ('extension/twilio/settings/settings.ini.php'); - require 'extension/twilio/vendor/twilio-php-master/Services/Twilio.php'; + require 'extension/twilio/vendor/autoload.php'; if ($this->settings['ahenviroment'] == true) { $this->ahinstance = erLhcoreClassInstance::getInstance(); @@ -449,10 +449,9 @@ public function sendManualMessage($params) } - $client = new Services_Twilio($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']); + $client = new Twilio\Rest\Client($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']); $paramsMMS = array( - 'To' => $paramsSend['recipient'], 'From' => $paramsSend['originator'], 'Body' => $paramsSend['text'] ); @@ -460,7 +459,10 @@ public function sendManualMessage($params) // Attach MMS if required $this->addMMSAttatchements($paramsMMS); - $client->account->messages->create($paramsMMS); + $client->messages->create( + $paramsSend['recipient'], + $paramsMMS + ); if ($params['create_chat'] == true) { @@ -624,7 +626,7 @@ public function sendSMSUser($params) } } - $client = new Services_Twilio($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']); + $client = new Twilio\Rest\Client($paramsSend['AccountSidSend'], $paramsSend['AuthTokenSend']); $paramsMMS = array( 'To' => $paramsSend['recipient'], @@ -635,7 +637,10 @@ public function sendSMSUser($params) // Attach MMS if required $this->addMMSAttatchements($paramsMMS); - $client->account->messages->create($paramsMMS); + $client->messages->create( + $paramsSend['recipient'], + $paramsMMS + ); if (! isset($chatVariables['twilio_sms_chat_send'])) { $chatVariables['twilio_sms_chat_send'] = 0; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..bfdceaf --- /dev/null +++ b/composer.json @@ -0,0 +1,24 @@ +{ + "name": "livehelperchat/twilio", + "version": "1.0", + "description": "Twilio for Live Helper Chat", + "type": "project", + "homepage": "https://livehelperchat.com/", + "license": "Apache-2.0", + "authors": [ + { + "name": "Live helper Chat", + "homepage": "https://livehelperchat.com/" + } + ], + "support": { + "email": "remdex@mgmail.com" + }, + "require": { + "php": ">=7.1.0", + "twilio/sdk": "^8.0" + }, + "config": { + "vendor-dir": "vendor" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..e407538 --- /dev/null +++ b/composer.lock @@ -0,0 +1,74 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "3789d80809ac28b31821c4097d1efe9c", + "packages": [ + { + "name": "twilio/sdk", + "version": "8.2.2", + "source": { + "type": "git", + "url": "https://github.com/twilio/twilio-php.git", + "reference": "10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twilio/twilio-php/zipball/10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f", + "reference": "10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpunit/phpunit": ">=7.0 < 10" + }, + "suggest": { + "guzzlehttp/guzzle": "An HTTP client to execute the API requests" + }, + "type": "library", + "autoload": { + "psr-4": { + "Twilio\\": "src/Twilio/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Twilio API Team", + "email": "api@twilio.com" + } + ], + "description": "A PHP wrapper for Twilio's API", + "homepage": "https://github.com/twilio/twilio-php", + "keywords": [ + "api", + "sms", + "twilio" + ], + "support": { + "issues": "https://github.com/twilio/twilio-php/issues", + "source": "https://github.com/twilio/twilio-php/tree/8.2.2" + }, + "time": "2024-07-02T09:32:09+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.1.0" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/vendor/autoload.php b/vendor/autoload.php new file mode 100644 index 0000000..34cfafa --- /dev/null +++ b/vendor/autoload.php @@ -0,0 +1,25 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..51e734a --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE new file mode 100644 index 0000000..f27399a --- /dev/null +++ b/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +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. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000..0fb0a2c --- /dev/null +++ b/vendor/composer/autoload_classmap.php @@ -0,0 +1,10 @@ + $vendorDir . '/composer/InstalledVersions.php', +); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php new file mode 100644 index 0000000..15a2ff3 --- /dev/null +++ b/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/twilio/sdk/src/Twilio'), +); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php new file mode 100644 index 0000000..7be3d28 --- /dev/null +++ b/vendor/composer/autoload_real.php @@ -0,0 +1,38 @@ +register(true); + + return $loader; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 0000000..cc4deb0 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,36 @@ + + array ( + 'Twilio\\' => 7, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Twilio\\' => + array ( + 0 => __DIR__ . '/..' . '/twilio/sdk/src/Twilio', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit3789d80809ac28b31821c4097d1efe9c::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit3789d80809ac28b31821c4097d1efe9c::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit3789d80809ac28b31821c4097d1efe9c::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json new file mode 100644 index 0000000..47af57c --- /dev/null +++ b/vendor/composer/installed.json @@ -0,0 +1,62 @@ +{ + "packages": [ + { + "name": "twilio/sdk", + "version": "8.2.2", + "version_normalized": "8.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/twilio/twilio-php.git", + "reference": "10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twilio/twilio-php/zipball/10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f", + "reference": "10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpunit/phpunit": ">=7.0 < 10" + }, + "suggest": { + "guzzlehttp/guzzle": "An HTTP client to execute the API requests" + }, + "time": "2024-07-02T09:32:09+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Twilio\\": "src/Twilio/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Twilio API Team", + "email": "api@twilio.com" + } + ], + "description": "A PHP wrapper for Twilio's API", + "homepage": "https://github.com/twilio/twilio-php", + "keywords": [ + "api", + "sms", + "twilio" + ], + "support": { + "issues": "https://github.com/twilio/twilio-php/issues", + "source": "https://github.com/twilio/twilio-php/tree/8.2.2" + }, + "install-path": "../twilio/sdk" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..dd2ae55 --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,32 @@ + array( + 'name' => 'livehelperchat/twilio', + 'pretty_version' => '1.0', + 'version' => '1.0.0.0', + 'reference' => null, + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + 'livehelperchat/twilio' => array( + 'pretty_version' => '1.0', + 'version' => '1.0.0.0', + 'reference' => null, + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'twilio/sdk' => array( + 'pretty_version' => '8.2.2', + 'version' => '8.2.2.0', + 'reference' => '10dbd6ecbc6ac1e0c61ab7d70c44e0794f8d3a1f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twilio/sdk', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 0000000..6d3407d --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/twilio-php-master/.gitignore b/vendor/twilio-php-master/.gitignore deleted file mode 100644 index f963629..0000000 --- a/vendor/twilio-php-master/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -docs/_build/ -vendor/* -composer.phar -coverage -package.xml -*.tgz - -# 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 diff --git a/vendor/twilio-php-master/.travis.yml b/vendor/twilio-php-master/.travis.yml deleted file mode 100644 index b695233..0000000 --- a/vendor/twilio-php-master/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: php -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm -matrix: - allow_failures: - - 7.0 - - hhvm -script: "make test" -before_install: "composer install --dev" diff --git a/vendor/twilio-php-master/AUTHORS.md b/vendor/twilio-php-master/AUTHORS.md deleted file mode 100644 index 45b44fd..0000000 --- a/vendor/twilio-php-master/AUTHORS.md +++ /dev/null @@ -1,45 +0,0 @@ -Authors -======= - -A huge thanks to all of our contributors: - - -- =noloh -- Adam Ballai -- Alex Chan -- Alex Rowley -- Alexandre Payment -- Andrew Nicols -- Brett Gerry -- Bulat Shakirzyanov -- Carlos Diaz-Padron -- Chris Barr -- D. Keith Casey, Jr. -- Doug Black -- Elliot Lings -- Jingming Niu -- John Britton -- John Wolthuis -- Jordi Boggiano -- Justin Witz -- Keith Casey -- Kevin Burke -- Kyle Conroy -- Luke Waite -- Matt Nowack -- Maxime Horcholle -- Neuman Vong -- Patrick Labbett -- Peter Meth -- Ryan Brideau -- Sam Kimbrel -- Shawn Parker -- Stuart Langley -- Taichiro Yoshida -- Trenton McManus -- aaronfoss -- alexw23 -- gramanathaiah -- sashalaundy -- tacman -- till diff --git a/vendor/twilio-php-master/CHANGES.md b/vendor/twilio-php-master/CHANGES.md deleted file mode 100644 index f9855cd..0000000 --- a/vendor/twilio-php-master/CHANGES.md +++ /dev/null @@ -1,388 +0,0 @@ -twilio-php Changelog -==================== - -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. - diff --git a/vendor/twilio-php-master/LICENSE b/vendor/twilio-php-master/LICENSE deleted file mode 100644 index a81ef8b..0000000 --- a/vendor/twilio-php-master/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (C) 2011, Twilio, Inc. -Copyright (C) 2011, Neuman Vong - -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. diff --git a/vendor/twilio-php-master/Makefile b/vendor/twilio-php-master/Makefile deleted file mode 100644 index 9fa1b2a..0000000 --- a/vendor/twilio-php-master/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -# Twilio API helper library. -# See LICENSE file for copyright and license details. - -define LICENSE - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -endef -export LICENSE - -COMPOSER = $(shell which composer) -ifeq ($(strip $(COMPOSER)),) - COMPOSER = php composer.phar -endif - -all: test - -clean: - @rm -rf dist venv - -PHP_FILES = `find dist -name \*.php` -dist: clean - @mkdir dist - @git archive master | (cd dist; tar xf -) - @for php in $(PHP_FILES); do\ - echo "$$LICENSE" > $$php.new; \ - tail -n+2 $$php >> $$php.new; \ - mv $$php.new $$php; \ - done - -test-install: - # Composer: http://getcomposer.org/download/ - $(COMPOSER) install - -install: - pear channel-discover twilio.github.com/pear - pear install twilio/Services_Twilio - -# if these fail, you may need to install the helper library - run "make -# test-install" -test: - @PATH=vendor/bin:$(PATH) phpunit --report-useless-tests --strict-coverage --disallow-test-output --colors --configuration tests/phpunit.xml; - -venv: - virtualenv venv - -docs-install: venv - . venv/bin/activate; pip install -r docs/requirements.txt - -docs: - . venv/bin/activate; cd docs && make html - -release-install: - pear channel-discover twilio.github.com/pear || true - pear channel-discover pear.pirum-project.org || true - pear install pirum/Pirum || true - pear install XML_Serializer-0.20.2 || true - pear install PEAR_PackageFileManager2 || true - -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 dist test docs docs-install test-install authors diff --git a/vendor/twilio-php-master/README.md b/vendor/twilio-php-master/README.md deleted file mode 100644 index 448224a..0000000 --- a/vendor/twilio-php-master/README.md +++ /dev/null @@ -1,122 +0,0 @@ -[![Build Status](https://secure.travis-ci.org/twilio/twilio-php.png?branch=master)](http://travis-ci.org/twilio/twilio-php) - -## 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. - -#### Via ZIP file: - -[Click here to download the source -(.zip)](https://github.com/twilio/twilio-php/zipball/master) which includes all -dependencies. - -Once you download the library, move the twilio-php folder to your project -directory and then include the library file: - - require '/path/to/twilio-php/Services/Twilio.php'; - -and you're good to go! - -## A Brief Introduction - -With the twilio-php library, we've simplified interaction with the -Twilio REST API. No need to manually create URLS or parse XML/JSON. -You now interact with resources directly. Follow the [Quickstart -Guide](http://readthedocs.org/docs/twilio-php/en/latest/#quickstart) -to get up and running right now. The [User -Guide](http://readthedocs.org/docs/twilio-php/en/latest/#user-guide) shows you -how to get the most out of **twilio-php**. - -## Quickstart - -### Send an SMS - -```php -account->messages->sendMessage( - '9991231234', // From a valid Twilio number - '8881231234', // Text this number - "Hello monkey!" -); - -print $message->sid; -``` - -### Make a Call - -```php -account->calls->create( - '9991231234', // From a valid Twilio number - '8881231234', // Call this number - - // Read TwiML at this URL when a call connects (hold music) - 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient' -); -``` - -### Generating TwiML - -To control phone calls, your application needs to output -[TwiML](http://www.twilio.com/docs/api/twiml/ "Twilio Markup Language"). Use -`Services_Twilio_Twiml` to easily create such responses. - -```php -say('Hello'); -$response->play('https://api.twilio.com/cowbell.mp3', array("loop" => 5)); -print $response; -``` - -That will output XML that looks like this: - -```xml - - - Hello - https://api.twilio.com/cowbell.mp3 - -``` - -## [Full Documentation](http://readthedocs.org/docs/twilio-php/en/latest/ "Twilio PHP Library Documentation") - -The documentation for **twilio-php** is hosted -at Read the Docs. [Click here to read our full -documentation.](http://readthedocs.org/docs/twilio-php/en/latest/ "Twilio PHP -Library Documentation") - -## Prerequisites - -* PHP >= 5.2.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! - diff --git a/vendor/twilio-php-master/Services/Twilio.php b/vendor/twilio-php-master/Services/Twilio.php deleted file mode 100644 index 63a7f36..0000000 --- a/vendor/twilio-php-master/Services/Twilio.php +++ /dev/null @@ -1,759 +0,0 @@ -version = in_array($version, $this->versions) ? $version : end($this->versions); - - if (null === $_http) { - if (!in_array('openssl', get_loaded_extensions())) { - throw new Services_Twilio_HttpException("The OpenSSL extension is required but not currently enabled. For more information, see http://php.net/manual/en/book.openssl.php"); - } - if (in_array('curl', get_loaded_extensions())) { - $_http = new Services_Twilio_TinyHttp( - $this->_getBaseUri(), - array( - "curlopts" => array( - CURLOPT_USERAGENT => self::qualifiedUserAgent(phpversion()), - CURLOPT_HTTPHEADER => array('Accept-Charset: utf-8'), - ), - ) - ); - } else { - $_http = new Services_Twilio_HttpStream( - $this->_getBaseUri(), - array( - "http_options" => array( - "http" => array( - "user_agent" => self::qualifiedUserAgent(phpversion()), - "header" => "Accept-Charset: utf-8\r\n", - ), - "ssl" => array( - 'verify_peer' => true, - 'verify_depth' => 5, - ), - ), - ) - ); - } - } - $_http->authenticate($sid, $token); - $this->http = $_http; - $this->retryAttempts = $retryAttempts; - } - - /** - * Build a query string from query data - * - * :param array $queryData: An associative array of keys and values. The - * values can be a simple type or a list, in which case the list is - * converted to multiple query parameters with the same key. - * :param string $numericPrefix: optional prefix to prepend to numeric keys - * :return: The encoded query string - * :rtype: string - */ - public static function buildQuery($queryData, $numericPrefix = '') { - $query = ''; - // Loop through all of the $query_data - foreach ($queryData as $key => $value) { - // If the key is an int, add the numeric_prefix to the beginning - if (is_int($key)) { - $key = $numericPrefix . $key; - } - - // If the value is an array, we will end up recursing - if (is_array($value)) { - // Loop through the values - foreach ($value as $value2) { - // Add an arg_separator if needed - if ($query !== '') { - $query .= '&'; - } - // Recurse - $query .= self::buildQuery(array($key => $value2), $numericPrefix); - } - } else { - // Add an arg_separator if needed - if ($query !== '') { - $query .= '&'; - } - // Add the key and the urlencoded value (as a string) - $query .= $key . '=' . urlencode((string)$value); - } - } - return $query; - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - $json_path = $full_uri ? $path : "$path.json"; - if (!$full_uri && !empty($params)) { - $query_path = $json_path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $json_path; - } - return $query_path; - } - - /** - * Fully qualified user agent with the current PHP Version. - * - * :return: the user agent - * :rtype: string - */ - public static function qualifiedUserAgent($php_version) { - return self::USER_AGENT . " (php $php_version)"; - } - - /** - * POST to the resource at the specified path. - * - * :param string $path: Path to the resource - * :param array $params: Query string parameters - * - * :return: The object representation of the resource - * :rtype: object - */ - public function createData($path, $params = array(), $full_uri = false) - { - if (!$full_uri) { - $path = "$path.json"; - } - $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); - $response = $this->http->post( - $path, $headers, self::buildQuery($params, '') - ); - return $this->_processResponse($response); - } - - /** - * DELETE the resource at the specified path. - * - * :param string $path: Path to the resource - * :param array $params: Query string parameters - * - * :return: The object representation of the resource - * :rtype: object - */ - public function deleteData($path, $params = array()) - { - $uri = $this->getRequestUri($path, $params); - return $this->_makeIdempotentRequest(array($this->http, 'delete'), - $uri, $this->retryAttempts); - } - - /** - * Get the retry attempt limit used by the rest client - * - * :return: the number of retry attempts - * :rtype: int - */ - public function getRetryAttempts() { - return $this->retryAttempts; - } - - /** - * Get the api version used by the rest client - * - * :return: the API version in use - * :returntype: string - */ - public function getVersion() { - return $this->version; - } - - /** - * GET the resource at the specified path. - * - * :param string $path: Path to the resource - * :param array $params: Query string parameters - * :param boolean $full_uri: Whether the full URI has been passed as an - * argument - * - * :return: The object representation of the resource - * :rtype: object - */ - public function retrieveData($path, $params = array(), - $full_uri = false - ) - { - $uri = $this->getRequestUri($path, $params, $full_uri); - return $this->_makeIdempotentRequest(array($this->http, 'get'), - $uri, $this->retryAttempts); - } - - /** - * Get the base URI for this client. - * - * :return: base URI - * :rtype: string - */ - protected function _getBaseUri() { - return 'https://api.twilio.com'; - } - - /** - * Helper method for implementing request retry logic - * - * :param array $callable: The function that makes an HTTP request - * :param string $uri: The URI to request - * :param int $retriesLeft: Number of times to retry - * - * :return: The object representation of the resource - * :rtype: object - */ - protected function _makeIdempotentRequest($callable, $uri, $retriesLeft) { - $response = call_user_func_array($callable, array($uri)); - list($status, $headers, $body) = $response; - if ($status >= 500 && $retriesLeft > 0) { - return $this->_makeIdempotentRequest($callable, $uri, $retriesLeft - 1); - } else { - return $this->_processResponse($response); - } - } - - /** - * Convert the JSON encoded resource into a PHP object. - * - * :param array $response: 3-tuple containing status, headers, and body - * - * :return: PHP object decoded from JSON - * :rtype: object - * :throws: A :php:class:`Services_Twilio_RestException` if the Response is - * in the 300-500 range of status codes. - */ - private function _processResponse($response) - { - list($status, $headers, $body) = $response; - if ($status === 204) { - return true; - } - $decoded = json_decode($body); - if ($decoded === null) { - throw new Services_Twilio_RestException( - $status, - 'Could not decode response body as JSON. ' . - 'This likely indicates a 500 server error' - ); - } - if (200 <= $status && $status < 300) { - $this->last_response = $decoded; - return $decoded; - } - throw new Services_Twilio_RestException( - $status, - isset($decoded->message) ? $decoded->message : '', - isset($decoded->code) ? $decoded->code : null, - isset($decoded->more_info) ? $decoded->more_info : null - ); - } -} - -/** - * Create a client to talk to the Twilio Rest API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('2008-08-01', '2010-04-01'); - - public function __construct( - $sid, - $token, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) - { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->accounts = new Services_Twilio_Rest_Accounts($this, "/{$this->version}/Accounts"); - $this->account = $this->accounts->get($sid); - } -} - -/** - * Create a client to talk to the Twilio TaskRouter API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $workspaceSid: - * Workspace SID to work with - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new TaskRouter_Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class TaskRouter_Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('v1'); - private $accountSid; - - public function __construct( - $sid, - $token, - $workspaceSid, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) - { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->workspaces = new Services_Twilio_Rest_TaskRouter_Workspaces($this, "/{$this->version}/Workspaces"); - $this->workspace = $this->workspaces->get($workspaceSid); - $this->accountSid = $sid; - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - if (!$full_uri && !empty($params)) { - $query_path = $path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $path; - } - return $query_path; - } - - public static function createWorkspace($sid, $token, $friendlyName, array $params = array(), Services_Twilio_TinyHttp $_http = null) - { - $taskrouterClient = new TaskRouter_Services_Twilio($sid, $token, null, null, $_http); - return $taskrouterClient->workspaces->create($friendlyName, $params); - } - - public function getTaskQueuesStatistics(array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/TaskQueues/Statistics", $params); - } - - public function getTaskQueueStatistics($taskQueueSid, array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/TaskQueues/{$taskQueueSid}/Statistics", $params); - } - - public function getWorkersStatistics(array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/Workers/Statistics", $params); - } - - public function getWorkerStatistics($workerSid, array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/Workers/{$workerSid}/Statistics", $params); - } - - public function getWorkflowStatistics($workflowSid, array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/Workflows/{$workflowSid}/Statistics", $params); - } - - public function getWorkspaceStatistics(array $params = array()) - { - return $this->retrieveData("/{$this->version}/Workspaces/{$this->workspace->sid}/Statistics", $params); - } - - protected function _getBaseUri() - { - return 'https://taskrouter.twilio.com'; - } -} - -/** - * Create a client to talk to the Twilio Lookups API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new Lookups_Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class Lookups_Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('v1'); - private $accountSid; - - public function __construct( - $sid, - $token, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) - { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->accountSid = $sid; - $this->phone_numbers = new Services_Twilio_Rest_Lookups_PhoneNumbers($this, "/{$this->version}/PhoneNumbers"); - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - if (!$full_uri && !empty($params)) { - $query_path = $path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $path; - } - return $query_path; - } - - /** - * Get the base URI for this client. - * - * :return: base URI - * :rtype: string - */ - protected function _getBaseUri() - { - return 'https://lookups.twilio.com'; - } - -} - -/** - * Create a client to talk to the Twilio Pricing API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new Pricing_Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class Pricing_Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('v1'); - - public function __construct( - $sid, - $token, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->voiceCountries = new Services_Twilio_Rest_Pricing_VoiceCountries( - $this, "/{$this->version}/Voice/Countries" - ); - $this->voiceNumbers = new Services_Twilio_Rest_Pricing_VoiceNumbers( - $this, "/{$this->version}/Voice/Numbers" - ); - $this->phoneNumberCountries = new Services_Twilio_Rest_Pricing_PhoneNumberCountries( - $this, "/{$this->version}/PhoneNumbers/Countries" - ); - $this->messagingCountries = new Services_Twilio_Rest_Pricing_MessagingCountries( - $this, "/{$this->version}/Messaging/Countries" - ); - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - if (!$full_uri && !empty($params)) { - $query_path = $path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $path; - } - return $query_path; - } - - protected function _getBaseUri() { - return 'https://pricing.twilio.com'; - } - -} - -/** - * Create a client to talk to the Twilio Monitor API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new Monitor_Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class Monitor_Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('v1'); - - public function __construct( - $sid, - $token, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) - { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->events = new Services_Twilio_Rest_Monitor_Events($this, "/{$this->version}/Events"); - $this->alerts = new Services_Twilio_Rest_Monitor_Alerts($this, "/{$this->version}/Alerts"); - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - if (!$full_uri && !empty($params)) { - $query_path = $path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $path; - } - return $query_path; - } - - protected function _getBaseUri() - { - return 'https://monitor.twilio.com'; - } - -} - -/** - * Create a client to talk to the Twilio SIP Trunking API. - * - * - * :param string $sid: Your Account SID - * :param string $token: Your Auth Token from `your dashboard - * `_ - * :param string $version: API version to use - * :param $_http: A HTTP client for making requests. - * :type $_http: :php:class:`Services_Twilio_TinyHttp` - * :param int $retryAttempts: - * Number of times to retry failed requests. Currently only idempotent - * requests (GET's and DELETE's) are retried. - * - * Here's an example: - * - * .. code-block:: php - * - * require('Services/Twilio.php'); - * $client = new Trunking_Services_Twilio('AC123', '456bef', null, null, 3); - * // Take some action with the client, etc. - */ -class Trunking_Services_Twilio extends Base_Services_Twilio -{ - protected $versions = array('v1'); - - public function __construct( - $sid, - $token, - $version = null, - Services_Twilio_TinyHttp $_http = null, - $retryAttempts = 1 - ) - { - parent::__construct($sid, $token, $version, $_http, $retryAttempts); - - $this->trunks = new Services_Twilio_Rest_Trunking_Trunks($this, "/{$this->version}/Trunks"); - } - - /** - * Construct a URI based on initial path, query params, and paging - * information - * - * We want to use the query params, unless we have a next_page_uri from the - * API. - * - * :param string $path: The request path (may contain query params if it's - * a next_page_uri) - * :param array $params: Query parameters to use with the request - * :param boolean $full_uri: Whether the $path contains the full uri - * - * :return: the URI that should be requested by the library - * :returntype: string - */ - public function getRequestUri($path, $params, $full_uri = false) - { - if (!$full_uri && !empty($params)) { - $query_path = $path . '?' . http_build_query($params, '', '&'); - } else { - $query_path = $path; - } - return $query_path; - } - - protected function _getBaseUri() - { - return 'https://trunking.twilio.com'; - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/AutoPagingIterator.php b/vendor/twilio-php-master/Services/Twilio/AutoPagingIterator.php deleted file mode 100644 index 5aacc49..0000000 --- a/vendor/twilio-php-master/Services/Twilio/AutoPagingIterator.php +++ /dev/null @@ -1,110 +0,0 @@ -generator = $generator; - $this->page = $page; - $this->size = $size; - $this->filters = $filters; - $this->next_page_uri = null; - $this->items = array(); - - // Save a backup for rewind() - $this->_args = array( - 'page' => $page, - 'size' => $size, - 'filters' => $filters, - ); - } - - public function current() - { - return current($this->items); - } - - public function key() - { - return key($this->items); - } - - /* - * Return the next item in the list, making another HTTP call to the next - * page of resources if necessary. - */ - public function next() - { - try { - $this->loadIfNecessary(); - return next($this->items); - } - catch (Services_Twilio_RestException $e) { - // 20006 is an out of range paging error, everything else is valid - if ($e->getCode() != 20006) { - throw $e; - } - } - } - - /* - * Restore everything to the way it was before we began paging. This gets - * called at the beginning of any foreach() loop - */ - public function rewind() - { - foreach ($this->_args as $arg => $val) { - $this->$arg = $val; - } - $this->items = array(); - $this->next_page_uri = null; - } - - public function count() - { - throw new BadMethodCallException('Not allowed'); - } - - public function valid() - { - try { - $this->loadIfNecessary(); - return key($this->items) !== null; - } - catch (Services_Twilio_RestException $e) { - // 20006 is an out of range paging error, everything else is valid - if ($e->getCode() != 20006) { - throw $e; - } - } - return false; - } - - /* - * Fill $this->items with a new page from the API, if necessary. - */ - protected function loadIfNecessary() - { - if (// Empty because it's the first time or last page was empty - empty($this->items) - // null key when the items list is iterated over completely - || key($this->items) === null - ) { - $page = call_user_func_array($this->generator, array( - $this->page, - $this->size, - $this->filters, - $this->next_page_uri, - )); - $this->next_page_uri = $page->next_page_uri; - $this->items = $page->getItems(); - $this->page = $this->page + 1; - } - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Capability.php b/vendor/twilio-php-master/Services/Twilio/Capability.php deleted file mode 100755 index f41956a..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Capability.php +++ /dev/null @@ -1,185 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_Capability -{ - public $accountSid; - public $authToken; - 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 $accountSid the account sid to which this token is granted access - * @param $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 - */ - 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 $appSid the application to which this token grants access - * @param $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 $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 $ttl the expiration time of the token (in seconds). Default - * value is 3600 (1hr) - * @return 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); - } -} - -/** - * Scope URI implementation - * - * Simple way to represent configurable privileges in an OAuth - * friendly way. For our case, they look like this: - * - * scope::? - * - * For example: - * scope:client:incoming?name=jonas - * - * @author Jeff Lindsay - */ -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 - */ - 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); - } - -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/CapabilityAPI.php b/vendor/twilio-php-master/Services/Twilio/CapabilityAPI.php deleted file mode 100755 index 3541375..0000000 --- a/vendor/twilio-php-master/Services/Twilio/CapabilityAPI.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_API_Capability -{ - protected $accountSid; - protected $authToken; - private $version; - private $friendlyName; - private $policies; - - public function __construct($accountSid, $authToken, $version, $friendlyName) - { - $this->accountSid = $accountSid; - $this->authToken = $authToken; - $this->version = $version; - $this->friendlyName = $friendlyName; - $this->policies = array(); - } - - 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); - } - - /** - * @deprecated Please use {Services_Twilio_API_Capability.allow, Services_Twilio_API_Capability.disallow} instead - */ - public function addPolicy($policy) { - array_push($this->policies, $policy); - } - - /** - * @deprecated Please use {Services_Twilio_API_Capability.allow, Services_Twilio_API_Capability.disallow} instead - */ - public function generatePolicy($url, $method, $queryFilter = array(), $postFilter = array(), $allow = true) - { - return $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, $allow); - } - - /** - * @deprecated Please use {Services_Twilio_API_Capability.allow, Services_Twilio_API_Capability.disallow} instead - */ - public function generateAndAddPolicy($url, $method, $queryFilter = array(), $postFilter = array(), $allow = true) { - $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, $allow); - } - - /** - * Generates a new token based on the credentials and permissions that - * previously has been granted to this token. - * - * @param $ttl the expiration time of the token (in seconds). Default - * value is 3600 (1hr) - * @param $extraAttributes extra attributes to be tied to the jwt. - * @return the newly generated token that is valid for $ttl seconds - */ - public function generateToken($ttl = 3600, $extraAttributes = null) - { - $payload = array( - 'version' => $this->version, - 'friendly_name' => $this->friendlyName, - 'policies' => array(), - 'iss' => $this->accountSid, - 'exp' => time() + $ttl - ); - if(isset($extraAttributes)) { - 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'); - } -} - -/** - * Twilio API Policy constructor - * - * @category Services - * @package Services_Twilio - * @author Justin Witz - * @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; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/CapabilityTaskRouter.php b/vendor/twilio-php-master/Services/Twilio/CapabilityTaskRouter.php deleted file mode 100644 index 942feb2..0000000 --- a/vendor/twilio-php-master/Services/Twilio/CapabilityTaskRouter.php +++ /dev/null @@ -1,252 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_TaskRouter_Capability extends Services_Twilio_API_Capability -{ - 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) { - parent::__construct($accountSid, $authToken, $this->version, $channelId); - - $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() { - if(substr($this->channelId,0,2) == 'WS') { - $this->resourceUrl = $this->baseUrl; - }else if(substr($this->channelId,0,2) == 'WK') { - $this->resourceUrl = $this->baseUrl.'/Workers/'.$this->channelId; - - //add permissions to fetch the list of activities and list of worker reservations - $activityUrl = $this->baseUrl.'/Activities'; - $this->allow($activityUrl, "GET", null, null); - - $reservationsUrl = $this->baseUrl.'/Tasks/**'; - $this->allow($reservationsUrl, "GET", null, null); - - }else if(substr($this->channelId,0,2) == 'WQ') { - $this->resourceUrl = $this->baseUrl.'/TaskQueues/'.$this->channelId; - } - } - - 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); - } - - /** - * @deprecated Please use {Services_Twilio_TaskRouter_Worker_Capability.allowActivityUpdates} instead - */ - public function allowWorkerActivityUpdates() { - $method = 'POST'; - $queryFilter = array(); - $postFilter = array("ActivitySid" => $this->required); - $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); - } - - /** - * @deprecated Please use {Services_Twilio_TaskRouter_Worker_Capability} instead; added automatically in constructor - */ - public function allowWorkerFetchAttributes() { - $method = 'GET'; - $queryFilter = array(); - $postFilter = array(); - $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); - } - - /** - * @deprecated Please use {Services_Twilio_TaskRouter_Worker_Capability.allowReservationUpdates} instead - */ - public function allowTaskReservationUpdates() { - $method = 'POST'; - $queryFilter = array(); - $postFilter = array(); - $reservationsUrl = $this->baseUrl.'/Tasks/**'; - $this->allow($reservationsUrl, $method, $queryFilter, $postFilter); - } - - public function generateToken($ttl = 3600, $extraAttributes = null) { - $taskRouterAttributes = array( - 'account_sid' => $this->accountSid, - 'channel' => $this->channelId, - 'workspace_sid' => $this->workspaceSid - ); - - if(substr($this->channelId,0,2) == 'WK') { - $taskRouterAttributes['worker_sid'] = $this->channelId; - }else if(substr($this->channelId,0,2) == 'WQ') { - $taskRouterAttributes['taskqueue_sid'] = $this->channelId; - } - - return parent::generateToken($ttl, $taskRouterAttributes); - } -} - - -/** - * Twilio TaskRouter Worker Capability assigner - * - * @category Services - * @package Services_Twilio - * @author Justin Witz - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_TaskRouter_Worker_Capability extends Services_Twilio_TaskRouter_Capability -{ - private $reservationsUrl; - private $activityUrl; - - public function __construct($accountSid, $authToken, $workspaceSid, $workerSid, $overrideBaseUrl = null, $overrideBaseWSUrl = null) - { - parent::__construct($accountSid, $authToken, $workspaceSid, $workerSid, null, $overrideBaseUrl, $overrideBaseWSUrl); - - $this->reservationsUrl = $this->baseUrl.'/Tasks/**'; - $this->activityUrl = $this->baseUrl.'/Activities'; - - //add permissions to fetch the list of activities and list of worker reservations - $this->allow($this->activityUrl, "GET", null, null); - $this->allow($this->reservationsUrl, "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->reservationsUrl, $method, $queryFilter, $postFilter); - } -} - -/** - * Twilio TaskRouter TaskQueue Capability assigner - * - * @category Services - * @package Services_Twilio - * @author Justin Witz - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_TaskRouter_TaskQueue_Capability extends Services_Twilio_TaskRouter_Capability -{ - 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; - } -} - -/** - * Twilio TaskRouter Workspace Capability assigner - * - * @category Services - * @package Services_Twilio - * @author Justin Witz - * @license http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_TaskRouter_Workspace_Capability extends Services_Twilio_TaskRouter_Capability -{ - 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; - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/HttpException.php b/vendor/twilio-php-master/Services/Twilio/HttpException.php deleted file mode 100644 index b79a357..0000000 --- a/vendor/twilio-php-master/Services/Twilio/HttpException.php +++ /dev/null @@ -1,3 +0,0 @@ - array( - "headers" => "", - "timeout" => 60, - "follow_location" => true, - "ignore_errors" => true, - ), - "ssl" => array(), - ); - private $options = array(); - - public function __construct($uri = '', $kwargs = array()) { - $this->uri = $uri; - if (isset($kwargs['debug'])) { - $this->debug = true; - } - if (isset($kwargs['http_options'])) { - $this->options = $kwargs['http_options'] + self::$default_options; - } else { - $this->options = self::$default_options; - } - } - - public function __call($name, $args) { - list($res, $req_headers, $req_body) = $args + array(0, array(), ''); - - if (strpos($res, 'http') === 0) { - $url = $res; - } else { - $url = $this->uri . $res; - } - - $request_options = $this->options; - - if (isset($req_body) && strlen($req_body) > 0) { - $request_options['http']['content'] = $req_body; - } - - foreach($req_headers as $key => $value) { - $request_options['http']['header'] .= sprintf("%s: %s\r\n", $key, $value); - } - - if (isset($this->auth_header)) { - $request_options['http']['header'] .= $this->auth_header; - } - - $request_options['http']['method'] = strtoupper($name); - $request_options['http']['ignore_errors'] = true; - - if ($this->debug) { - error_log(var_export($request_options, true)); - } - $ctx = stream_context_create($request_options); - $result = file_get_contents($url, false, $ctx); - - if (false === $result) { - throw new Services_Twilio_HttpStreamException( - "Unable to connect to service"); - } - - $status_header = array_shift($http_response_header); - if (1 !== preg_match('#HTTP/\d+\.\d+ (\d+)#', $status_header, $matches)) { - throw new Services_Twilio_HttpStreamException( - "Unable to detect the status code in the HTTP result."); - } - - $status_code = intval($matches[1]); - $response_headers = array(); - - foreach($http_response_header as $header) { - list($key, $val) = explode(":", $header); - $response_headers[trim($key)] = trim($val); - } - - return array($status_code, $response_headers, $result); - } - - public function authenticate($user, $pass) { - if (isset($user) && isset($pass)) { - $this->auth_header = sprintf("Authorization: Basic %s", - base64_encode(sprintf("%s:%s", $user, $pass))); - } else { - $this->auth_header = null; - } - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/InstanceResource.php b/vendor/twilio-php-master/Services/Twilio/InstanceResource.php deleted file mode 100644 index 0d4932d..0000000 --- a/vendor/twilio-php-master/Services/Twilio/InstanceResource.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ - -/** - * Abstraction of an instance resource from the Twilio API. - */ -abstract class Services_Twilio_InstanceResource extends Services_Twilio_Resource { - - /** - * Make a request to the API to update an instance resource - * - * :param mixed $params: An array of updates, or a property name - * :param mixed $value: A value with which to update the resource - * - * :rtype: null - * :throws: a :php:class:`RestException ` if - * the update fails. - */ - public function update($params, $value = null) - { - if (!is_array($params)) { - $params = array($params => $value); - } - $decamelizedParams = $this->client->createData($this->uri, $params); - $this->updateAttributes($decamelizedParams); - } - - /** - * Add all properties from an associative array (the JSON response body) as - * properties on this instance resource, except the URI - * - * :param stdClass $params: An object containing all of the parameters of - * this instance - * :return: Nothing, this is purely side effecting - * :rtype: null - */ - public function updateAttributes($params) { - unset($params->uri); - foreach ($params as $name => $value) { - $this->$name = $value; - } - } - - /** - * Get the value of a property on this resource. - * - * Instead of defining all of the properties of an object directly, we rely - * on the API to tell us which properties an object has. This method will - * query the API to retrieve a property for an object, if it is not already - * set on the object. - * - * If the call is to a subresource, eg ``$client->account->messages``, no - * request is made. - * - * To help with lazy HTTP requests, we don't actually retrieve an object - * from the API unless you really need it. Hence, this function may make API - * requests even if the property you're requesting isn't available on the - * resource. - * - * :param string $key: The property name - * - * :return mixed: Could be anything. - * :throws: a :php:class:`RestException ` if - * the update fails. - */ - public function __get($key) - { - if ($subresource = $this->getSubresources($key)) { - return $subresource; - } - if (!isset($this->$key)) { - $params = $this->client->retrieveData($this->uri); - $this->updateAttributes($params); - } - return $this->$key; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/JWT.php b/vendor/twilio-php-master/Services/Twilio/JWT.php deleted file mode 100644 index 1b22a2d..0000000 --- a/vendor/twilio-php-master/Services/Twilio/JWT.php +++ /dev/null @@ -1,162 +0,0 @@ - - */ -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 - */ - 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 = JWT::jsonDecode(JWT::urlsafeB64Decode($headb64))) - ) { - throw new UnexpectedValueException('Invalid segment encoding'); - } - if (null === $payload = JWT::jsonDecode(JWT::urlsafeB64Decode($payloadb64)) - ) { - throw new UnexpectedValueException('Invalid segment encoding'); - } - $sig = JWT::urlsafeB64Decode($cryptob64); - if ($verify) { - if (empty($header->alg)) { - throw new DomainException('Empty algorithm'); - } - if ($sig != JWT::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 - * - * @return string A JWT - */ - public static function encode($payload, $key, $algo = 'HS256') - { - $header = array('typ' => 'JWT', 'alg' => $algo); - - $segments = array(); - $segments[] = JWT::urlsafeB64Encode(JWT::jsonEncode($header)); - $segments[] = JWT::urlsafeB64Encode(JWT::jsonEncode($payload)); - $signing_input = implode('.', $segments); - - $signature = JWT::sign($signing_input, $key, $algo); - $segments[] = JWT::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 - */ - 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 - */ - public static function jsonDecode($input) - { - $obj = json_decode($input); - if (function_exists('json_last_error') && $errno = json_last_error()) { - JWT::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 - */ - public static function jsonEncode($input) - { - $json = json_encode($input); - if (function_exists('json_last_error') && $errno = json_last_error()) { - JWT::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() - * - * @return void - */ - 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 - ); - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/ListResource.php b/vendor/twilio-php-master/Services/Twilio/ListResource.php deleted file mode 100644 index dad1c0d..0000000 --- a/vendor/twilio-php-master/Services/Twilio/ListResource.php +++ /dev/null @@ -1,182 +0,0 @@ -`_ and the `Countable - * `_ interfaces. - * - */ -abstract class Services_Twilio_ListResource extends Services_Twilio_Resource - implements IteratorAggregate -{ - - public function __construct($client, $uri) { - $name = $this->getResourceName(true); - /* - * By default trim the 's' from the end of the list name to get the - * instance name (ex Accounts -> Account). This behavior can be - * overridden by child classes if the rule doesn't work. - */ - if (!isset($this->instance_name)) { - $this->instance_name = "Services_Twilio_Rest_" . rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } - - /** - * Gets a resource from this list. - * - * :param string $sid: The resource SID - * :return: The resource - * :rtype: :php:class:`InstanceResource ` - */ - public function get($sid) { - $instance = new $this->instance_name( - $this->client, $this->uri . "/$sid" - ); - // XXX check if this is actually a sid in all cases. - $instance->sid = $sid; - return $instance; - } - - /** - * Construct an :php:class:`InstanceResource - * ` with the specified params. - * - * :param array $params: usually a JSON HTTP response from the API - * :return: An instance with properties - * initialized to the values in the params array. - * :rtype: :php:class:`InstanceResource ` - */ - public function getObjectFromJson($params, $idParam = "sid") - { - if (isset($params->{$idParam})) { - $uri = $this->uri . "/" . $params->{$idParam}; - } else { - $uri = $this->uri; - } - return new $this->instance_name($this->client, $uri, $params); - } - - /** - * Deletes a resource from this list. - * - * :param string $sid: The resource SID - * :rtype: null - */ - public function delete($sid, $params = array()) - { - $this->client->deleteData($this->uri . '/' . $sid, $params); - } - - /** - * Create a resource on the list and then return its representation as an - * InstanceResource. - * - * :param array $params: The parameters with which to create the resource - * - * :return: The created resource - * :rtype: :php:class:`InstanceResource ` - */ - protected function _create($params) - { - $params = $this->client->createData($this->uri, $params); - /* Some methods like verified caller ID don't return sids. */ - if (isset($params->sid)) { - $resource_uri = $this->uri . '/' . $params->sid; - } else { - $resource_uri = $this->uri; - } - return new $this->instance_name($this->client, $resource_uri, $params); - } - - /** - * Returns a page of :php:class:`InstanceResources - * ` from this list. - * - * :param int $page: The start page - * :param int $size: Number of items per page - * :param array $filters: Optional filters - * :param string $deep_paging_uri: if provided, the $page and $size - * parameters will be ignored and this URI will be requested directly. - * - * :return: A page of resources - * :rtype: :php:class:`Services_Twilio_Page` - */ - public function getPage( - $page = 0, $size = 50, $filters = array(), $deep_paging_uri = null - ) { - $list_name = $this->getResourceName(); - if ($deep_paging_uri !== null) { - $page = $this->client->retrieveData($deep_paging_uri, array(), true); - } else { - $page = $this->client->retrieveData($this->uri, array( - 'Page' => $page, - 'PageSize' => $size, - ) + $filters); - } - - /* create a new PHP object for each json obj in the api response. */ - $page->$list_name = array_map( - array($this, 'getObjectFromJson'), - $page->$list_name - ); - if (isset($page->next_page_uri)) { - $next_page_uri = $page->next_page_uri; - } else { - $next_page_uri = null; - } - return new Services_Twilio_Page($page, $list_name, $next_page_uri); - } - - /** - * Returns an iterable list of - * :php:class:`instance resources `. - * - * :param int $page: The start page - * :param int $size: Number of items per page - * :param array $filters: Optional filters. - * The filter array can accept full datetimes when StartTime or DateCreated - * are used. Inequalities should be within the key portion of the array and - * multiple filter parameters can be combined for more specific searches. - * - * .. code-block:: php - * - * array('DateCreated>' => '2011-07-05 08:00:00', 'DateCreated<' => '2011-08-01') - * - * .. code-block:: php - * - * array('StartTime<' => '2011-07-05 08:00:00') - * - * :return: An iterator - * :rtype: :php:class:`Services_Twilio_AutoPagingIterator` - */ - public function getIterator( - $page = 0, $size = 50, $filters = array() - ) { - return new Services_Twilio_AutoPagingIterator( - array($this, 'getPageGenerator'), $page, $size, $filters - ); - } - - /** - * Retrieve a new page of API results, and update iterator parameters. This - * function is called by the paging iterator to retrieve a new page and - * shouldn't be called directly. - */ - public function getPageGenerator( - $page, $size, $filters = array(), $deep_paging_uri = null - ) { - return $this->getPage($page, $size, $filters, $deep_paging_uri); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/LookupsInstanceResource.php b/vendor/twilio-php-master/Services/Twilio/LookupsInstanceResource.php deleted file mode 100644 index 63685ea..0000000 --- a/vendor/twilio-php-master/Services/Twilio/LookupsInstanceResource.php +++ /dev/null @@ -1,15 +0,0 @@ -subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/LookupsListResource.php b/vendor/twilio-php-master/Services/Twilio/LookupsListResource.php deleted file mode 100644 index 856d31b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/LookupsListResource.php +++ /dev/null @@ -1,39 +0,0 @@ -getResourceName(true); - /* - * By default trim the 's' from the end of the list name to get the - * instance name (ex Accounts -> Account). This behavior can be - * overridden by child classes if the rule doesn't work. - */ - if (!isset($this->instance_name)) { - $this->instance_name = "Services_Twilio_Rest_Lookups_" . rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } - - /** - * Gets a resource from this list. Overridden to add - * filter parameters. - * - * :param string $number: The phone number - * :return: The resource - * :rtype: :php:class:`InstanceResource ` - */ - public function get($number, $filters = array()) { - $number = rawurlencode($number); - $full_path = $this->uri . "/$number"; - if (!empty($filters)) { - $full_path .= '?' . http_build_query($filters, '', '&'); - } - - $instance = new $this->instance_name( - $this->client, $full_path - ); - return $instance; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/MonitorInstanceResource.php b/vendor/twilio-php-master/Services/Twilio/MonitorInstanceResource.php deleted file mode 100644 index bf4c300..0000000 --- a/vendor/twilio-php-master/Services/Twilio/MonitorInstanceResource.php +++ /dev/null @@ -1,15 +0,0 @@ -subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/MonitorListResource.php b/vendor/twilio-php-master/Services/Twilio/MonitorListResource.php deleted file mode 100644 index 70604e3..0000000 --- a/vendor/twilio-php-master/Services/Twilio/MonitorListResource.php +++ /dev/null @@ -1,18 +0,0 @@ -getResourceName(true); - /* - * By default trim the 's' from the end of the list name to get the - * instance name (ex Accounts -> Account). This behavior can be - * overridden by child classes if the rule doesn't work. - */ - if (!isset($this->instance_name)) { - $this->instance_name = "Services_Twilio_Rest_Monitor_" . rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/NextGenInstanceResource.php b/vendor/twilio-php-master/Services/Twilio/NextGenInstanceResource.php deleted file mode 100644 index dd17dfe..0000000 --- a/vendor/twilio-php-master/Services/Twilio/NextGenInstanceResource.php +++ /dev/null @@ -1,23 +0,0 @@ -` if - * the update fails. - */ - public function update($params, $value = null) - { - if (!is_array($params)) { - $params = array($params => $value); - } - $decamelizedParams = $this->client->createData($this->uri, $params, true); - $this->updateAttributes($decamelizedParams); - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/NextGenListResource.php b/vendor/twilio-php-master/Services/Twilio/NextGenListResource.php deleted file mode 100644 index 8822d1b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/NextGenListResource.php +++ /dev/null @@ -1,60 +0,0 @@ -client->retrieveData($deep_paging_uri, array(), true); - } else if ($page == 0) { - $page = $this->client->retrieveData($this->uri, array('Page' => $page, 'PageSize' => $size) + $filters); - } else { - return $this->emptyPage(); - } - - $list_name = $page->meta->key; - if (!isset($list_name) || $list_name === '') { - throw new Services_Twilio_HttpException("Couldn't find list key in response"); - } - - $page->$list_name = array_map( - array($this, 'getObjectFromJson'), - $page->$list_name - ); - $page->next_page_uri = $page->meta->next_page_url; - - return new Services_Twilio_Page($page, $list_name, $page->meta->next_page_url); - } - - private function emptyPage() { - $page = new stdClass(); - $page->empty = array(); - return new Services_Twilio_Page($page, 'empty'); - } - - /** - * Create a resource on the list and then return its representation as an - * InstanceResource. - * - * :param array $params: The parameters with which to create the resource - * - * :return: The created resource - * :rtype: :php:class:`InstanceResource ` - */ - protected function _create($params) - { - $params = $this->client->createData($this->uri, $params, true); - /* Some methods like verified caller ID don't return sids. */ - if (isset($params->sid)) { - $resource_uri = $this->uri . '/' . $params->sid; - } else { - $resource_uri = $this->uri; - } - return new $this->instance_name($this->client, $resource_uri, $params); - } - - public function count() { - throw new BadMethodCallException("Counting is not supported by this resource"); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/NumberType.php b/vendor/twilio-php-master/Services/Twilio/NumberType.php deleted file mode 100644 index 0683d99..0000000 --- a/vendor/twilio-php-master/Services/Twilio/NumberType.php +++ /dev/null @@ -1,35 +0,0 @@ -instance_name = 'Services_Twilio_Rest_IncomingPhoneNumber'; - return $camelized ? 'IncomingPhoneNumbers' : 'incoming_phone_numbers'; - } - - /** - * Purchase a new phone number. - * - * Example usage: - * - * .. code-block:: php - * - * $marlosBurner = '+14105551234'; - * $client->account->incoming_phone_numbers->local->purchase($marlosBurner); - * - * :param string $phone_number: The phone number to purchase - * :param array $params: An optional array of parameters to pass along with - * the request (to configure the phone number) - */ - public function purchase($phone_number, array $params = array()) { - $postParams = array( - 'PhoneNumber' => $phone_number - ); - return $this->create($postParams + $params); - } - - public function create(array $params = array()) { - return parent::_create($params); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Page.php b/vendor/twilio-php-master/Services/Twilio/Page.php deleted file mode 100644 index 61ddb07..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Page.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -class Services_Twilio_Page - implements IteratorAggregate -{ - - /** - * The item list. - * - * @var array $items - */ - protected $items; - - /** - * Constructs a page. - * - * @param object $page The page object - * @param string $name The key of the item list - */ - public function __construct($page, $name, $next_page_uri = null) - { - $this->page = $page; - $this->items = $page->{$name}; - $this->next_page_uri = $next_page_uri; - } - - /** - * The item list of the page. - * - * @return array A list of instance resources - */ - public function getItems() - { - return $this->items; - } - - /** - * Magic method to allow retrieving the properties of the wrapped page. - * - * @param string $prop The property name - * - * @return mixed Could be anything - */ - public function __get($prop) - { - return $this->page->$prop; - } - - /** - * Implementation of IteratorAggregate::getIterator(). - * - * @return Traversable - */ - public function getIterator() - { - return $this->getItems(); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/PartialApplicationHelper.php b/vendor/twilio-php-master/Services/Twilio/PartialApplicationHelper.php deleted file mode 100644 index 639ca51..0000000 --- a/vendor/twilio-php-master/Services/Twilio/PartialApplicationHelper.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -class Services_Twilio_PartialApplicationHelper -{ - private $callbacks; - - public function __construct() - { - $this->callbacks = array(); - } - - public function set($method, $callback, array $args) - { - if (!is_callable($callback)) { - return FALSE; - } - $this->callbacks[$method] = array($callback, $args); - } - - public function __call($method, $args) - { - if (!isset($this->callbacks[$method])) { - throw new Exception("Method not found: $method"); - } - list($callback, $cb_args) = $this->callbacks[$method]; - return call_user_func_array( - $callback, - array_merge($cb_args, $args) - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/PricingInstanceResource.php b/vendor/twilio-php-master/Services/Twilio/PricingInstanceResource.php deleted file mode 100644 index 6ae1e18..0000000 --- a/vendor/twilio-php-master/Services/Twilio/PricingInstanceResource.php +++ /dev/null @@ -1,14 +0,0 @@ -subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/PricingListResource.php b/vendor/twilio-php-master/Services/Twilio/PricingListResource.php deleted file mode 100644 index cc663e4..0000000 --- a/vendor/twilio-php-master/Services/Twilio/PricingListResource.php +++ /dev/null @@ -1,14 +0,0 @@ -getResourceName(true); - - if (!isset($this->instance_name)) { - $this->instance_name = 'Services_Twilio_Rest_Pricing_'. rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/RequestValidator.php b/vendor/twilio-php-master/Services/Twilio/RequestValidator.php deleted file mode 100644 index 52a40d9..0000000 --- a/vendor/twilio-php-master/Services/Twilio/RequestValidator.php +++ /dev/null @@ -1,36 +0,0 @@ -AuthToken = $token; - } - - 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 $this->computeSignature($url, $data) - == $expectedSignature; - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Resource.php b/vendor/twilio-php-master/Services/Twilio/Resource.php deleted file mode 100644 index 7485a7e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Resource.php +++ /dev/null @@ -1,134 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -abstract class Services_Twilio_Resource { - protected $subresources; - - public function __construct($client, $uri, $params = array()) - { - $this->subresources = array(); - $this->client = $client; - - foreach ($params as $name => $param) { - $this->$name = $param; - } - - $this->uri = $uri; - $this->init($client, $uri); - } - - protected function init($client, $uri) - { - // Left empty for derived classes to implement - } - - public function getSubresources($name = null) { - if (isset($name)) { - return isset($this->subresources[$name]) - ? $this->subresources[$name] - : null; - } - return $this->subresources; - } - - protected function setupSubresources() - { - foreach (func_get_args() as $name) { - $constantized = ucfirst(self::camelize($name)); - $type = "Services_Twilio_Rest_" . $constantized; - $this->subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } - - /* - * Get the resource name from the classname - * - * Ex: Services_Twilio_Rest_Accounts -> Accounts - * - * @param boolean $camelized Whether to return camel case or not - */ - public function getResourceName($camelized = false) - { - $name = get_class($this); - $parts = explode('_', $name); - $basename = end($parts); - if ($camelized) { - return $basename; - } else { - return self::decamelize($basename); - } - } - - public static function decamelize($word) - { - $callback = create_function('$matches', - 'return strtolower(strlen("$matches[1]") ? "$matches[1]_$matches[2]" : "$matches[2]");'); - - return preg_replace_callback( - '/(^|[a-z])([A-Z])/', - $callback, - $word - ); - } - - /** - * Return camelized version of a word - * Examples: sms_messages => SMSMessages, calls => Calls, - * incoming_phone_numbers => IncomingPhoneNumbers - * - * @param string $word The word to camelize - * @return string - */ - public static function camelize($word) { - $callback = @create_function('$matches', 'return strtoupper("$matches[2]");'); - - return preg_replace_callback('/(^|_)([a-z])/', - $callback, - $word); - } - - /** - * Get the value of a property on this resource. - * - * @param string $key The property name - * @return mixed Could be anything. - */ - public function __get($key) { - if ($subresource = $this->getSubresources($key)) { - return $subresource; - } - return $this->$key; - } - - /** - * Print a JSON representation of this object. Strips the HTTP client - * before returning. - * - * Note, this should mainly be used for debugging, and is not guaranteed - * to correspond 1:1 with the JSON API output. - * - * Note that echoing an object before an HTTP request has been made to - * "fill in" its properties may return an empty object - */ - public function __toString() { - $out = array(); - foreach ($this as $key => $value) { - if ($key !== 'client' && $key !== 'subresources') { - $out[$key] = $value; - } - } - return json_encode($out, true); - } - -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Account.php b/vendor/twilio-php-master/Services/Twilio/Rest/Account.php deleted file mode 100644 index dc137d3..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Account.php +++ /dev/null @@ -1,36 +0,0 @@ -setupSubresources( - 'applications', - 'available_phone_numbers', - 'outgoing_caller_ids', - 'calls', - 'conferences', - 'incoming_phone_numbers', - 'keys', - 'media', - 'messages', - 'notifications', - 'outgoing_callerids', - 'recordings', - 'sms_messages', - 'short_codes', - 'tokens', - 'transcriptions', - 'connect_apps', - 'authorized_connect_apps', - 'usage_records', - 'usage_triggers', - 'queues', - 'sip', - 'addresses' - ); - - $this->sandbox = new Services_Twilio_Rest_Sandbox( - $client, $uri . '/Sandbox' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Accounts.php b/vendor/twilio-php-master/Services/Twilio/Rest/Accounts.php deleted file mode 100644 index 0e7ea0a..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Accounts.php +++ /dev/null @@ -1,25 +0,0 @@ -`_ documentation. - */ -class Services_Twilio_Rest_Accounts extends Services_Twilio_ListResource { - - /** - * Create a new subaccount. - * - * :param array $params: An array of parameters describing the new - * subaccount. The ``$params`` array can contain the following keys: - * - * *FriendlyName* - * A description of this account, up to 64 characters long - * - * :returns: The new subaccount - * :rtype: :php:class:`Services_Twilio_Rest_Account` - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Address.php b/vendor/twilio-php-master/Services/Twilio/Rest/Address.php deleted file mode 100644 index 1110257..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Address.php +++ /dev/null @@ -1,12 +0,0 @@ -setupSubresources( - 'dependent_phone_numbers' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Addresses.php b/vendor/twilio-php-master/Services/Twilio/Rest/Addresses.php deleted file mode 100644 index 93a6040..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Addresses.php +++ /dev/null @@ -1,6 +0,0 @@ - $name - ) + $params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/AuthorizedConnectApp.php b/vendor/twilio-php-master/Services/Twilio/Rest/AuthorizedConnectApp.php deleted file mode 100644 index 0372629..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/AuthorizedConnectApp.php +++ /dev/null @@ -1,6 +0,0 @@ -set( - 'getList', - array($this, 'getList'), - array($country, 'Local') - ); - return $curried; - } - public function getTollFree($country) { - $curried = new Services_Twilio_PartialApplicationHelper(); - $curried->set( - 'getList', - array($this, 'getList'), - array($country, 'TollFree') - ); - return $curried; - } - - public function getMobile($country) - { - $curried = new Services_Twilio_PartialApplicationHelper(); - $curried->set( - 'getList', - array($this, 'getList'), - array($country, 'Mobile') - ); - return $curried; - } - - /** - * Get a list of available phone numbers. - * - * @param string $country The 2-digit country code you'd like to search for - * numbers e.g. ('US', 'CA', 'GB') - * @param string $type The type of number ('Local', 'TollFree', or 'Mobile') - * @return object The object representation of the resource - */ - public function getList($country, $type, array $params = array()) - { - return $this->client->retrieveData($this->uri . "/$country/$type", $params); - } - - public function getResourceName($camelized = false) { - // You can't page through the list of available phone numbers. - $this->instance_name = 'Services_Twilio_Rest_AvailablePhoneNumber'; - return $camelized ? 'Countries' : 'countries'; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Call.php b/vendor/twilio-php-master/Services/Twilio/Rest/Call.php deleted file mode 100644 index 1a9f696..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Call.php +++ /dev/null @@ -1,116 +0,0 @@ -`_ documentation. - * - * .. php:attr:: sid - * - * A 34 character string that uniquely identifies this resource. - * - * .. php:attr:: parent_call_sid - * - * A 34 character string that uniquely identifies the call that created this leg. - * - * .. php:attr:: date_created - * - * The date that this resource was created, given as GMT in RFC 2822 format. - * - * .. php:attr:: date_updated - * - * The date that this resource was last updated, given as GMT in RFC 2822 format. - * - * .. php:attr:: account_sid - * - * The unique id of the Account responsible for creating this call. - * - * .. php:attr:: to - * - * The phone number that received this call. e.g., +16175551212 (E.164 format) - * - * .. php:attr:: from - * - * The phone number that made this call. e.g., +16175551212 (E.164 format) - * - * .. php:attr:: phone_number_sid - * - * If the call was inbound, this is the Sid of the IncomingPhoneNumber that - * received the call. If the call was outbound, it is the Sid of the - * OutgoingCallerId from which the call was placed. - * - * .. php:attr:: status - * - * A string representing the status of the call. May be `QUEUED`, `RINGING`, - * `IN-PROGRESS`, `COMPLETED`, `FAILED`, `BUSY` or `NO_ANSWER`. - * - * .. php:attr:: start_time - * - * The start time of the call, given as GMT in RFC 2822 format. Empty if the call has not yet been dialed. - * - * .. php:attr:: end_time - * - * The end time of the call, given as GMT in RFC 2822 format. Empty if the call did not complete successfully. - * - * .. php:attr:: duration - * - * The length of the call in seconds. This value is empty for busy, failed, unanswered or ongoing calls. - * - * .. php:attr:: price - * - * The charge for this call in USD. Populated after the call is completed. May not be immediately available. - * - * .. php:attr:: direction - * - * A string describing the direction of the call. inbound for inbound - * calls, outbound-api for calls initiated via the REST API or - * outbound-dial for calls initiated by a verb. - * - * .. php:attr:: answered_by - * - * If this call was initiated with answering machine detection, either human or machine. Empty otherwise. - * - * .. php:attr:: forwarded_from - * - * If this call was an incoming call forwarded from another number, the - * forwarding phone number (depends on carrier supporting forwarding). - * Empty otherwise. - * - * .. php:attr:: caller_name - * - * If this call was an incoming call from a phone number with Caller ID Lookup enabled, the caller's name. Empty otherwise. - */ -class Services_Twilio_Rest_Call extends Services_Twilio_InstanceResource { - - /** - * Hang up the call - */ - public function hangup() { - $this->update('Status', 'completed'); - } - - /** - * Redirect the call to a new URL - * - * :param string $url: the new URL to retrieve call flow from. - */ - public function route($url) { - $this->update('Url', $url); - } - - protected function init($client, $uri) { - $this->setupSubresources( - 'notifications', - 'recordings', - 'feedback' - ); - } - - /** - * Make a request to delete the specified resource. - * - * :rtype: boolean - */ - public function delete() - { - return $this->client->deleteData($this->uri); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Calls.php b/vendor/twilio-php-master/Services/Twilio/Rest/Calls.php deleted file mode 100644 index a140654..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Calls.php +++ /dev/null @@ -1,77 +0,0 @@ -setupSubresources( - 'feedback_summary' - ); - } - - public static function isApplicationSid($value) - { - return strlen($value) == 34 - && !(strpos($value, "AP") === false); - } - - public function create($from, $to, $url, array $params = array()) - { - - $params["To"] = $to; - $params["From"] = $from; - - if (self::isApplicationSid($url)) { - $params["ApplicationSid"] = $url; - } else { - $params["Url"] = $url; - } - - return parent::_create($params); - } - - /** - * Create a feedback for a call. - * - * @param $callSid - * @param $qualityScore - * @param array $issue - * @return Services_Twilio_Rest_Feedback - */ - public function createFeedback($callSid, $qualityScore, array $issue = array()) - { - $params["QualityScore"] = $qualityScore; - $params["Issue"] = $issue; - - $feedbackUri = $this->uri . '/' . $callSid . '/Feedback'; - - $response = $this->client->createData($feedbackUri, $params); - return new Services_Twilio_Rest_Feedback($this->client, $feedbackUri, $response); - } - - /** - * Delete a feedback for a call. - * - * @param $callSid - */ - public function deleteFeedback($callSid) - { - $feedbackUri = $this->uri . '/' . $callSid . '/Feedback'; - $this->client->deleteData($feedbackUri); - } - - /** - * Get a feedback for a call. - * - * @param $callSid - * @return Services_Twilio_Rest_Feedback - */ - public function getFeedback($callSid) - { - $feedbackUri = $this->uri . '/' . $callSid . '/Feedback'; - $response = $this->client->retrieveData($feedbackUri); - return new Services_Twilio_Rest_Feedback($this->client, $feedbackUri, $response); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Conference.php b/vendor/twilio-php-master/Services/Twilio/Rest/Conference.php deleted file mode 100644 index 9a36916..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Conference.php +++ /dev/null @@ -1,12 +0,0 @@ -setupSubresources( - 'participants' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Conferences.php b/vendor/twilio-php-master/Services/Twilio/Rest/Conferences.php deleted file mode 100644 index 5e92e37..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Conferences.php +++ /dev/null @@ -1,6 +0,0 @@ -setupSubresources( - 'credentials' - ); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMapping.php b/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMapping.php deleted file mode 100644 index 3f9c305..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMapping.php +++ /dev/null @@ -1,37 +0,0 @@ -setupSubresources( - 'credentials' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMappings.php b/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMappings.php deleted file mode 100644 index ab34f60..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialListMappings.php +++ /dev/null @@ -1,24 +0,0 @@ -account->sip->domains->get('SDXXX')->credential_list_mappings->create("CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - * - * :param string $credential_list_sid: the sid of the CredentialList you're adding to this domain. - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($credential_list_sid, $params = array()) { - return parent::_create(array( - 'CredentialListSid' => $credential_list_sid, - ) + $params); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialLists.php b/vendor/twilio-php-master/Services/Twilio/Rest/CredentialLists.php deleted file mode 100644 index e8eb1a6..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/CredentialLists.php +++ /dev/null @@ -1,24 +0,0 @@ -account->sip->credential_lists->create("MyFriendlyName"); - * - * :param string $friendly_name: the friendly name of this credential list - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($friendly_name, $params = array()) { - return parent::_create(array( - 'FriendlyName' => $friendly_name, - ) + $params); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Credentials.php b/vendor/twilio-php-master/Services/Twilio/Rest/Credentials.php deleted file mode 100644 index 129a44d..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Credentials.php +++ /dev/null @@ -1,28 +0,0 @@ -account->sip->credential_lists->get('CLXXX')->credentials->create( - * "AwesomeUsername", "SuperSecretPassword", - * ); - * - * :param string $username: the username for the new Credential object - * :param string $password: the password for the new Credential object - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($username, $password, $params = array()) { - return parent::_create(array( - 'Username' => $username, - 'Password' => $password, - ) + $params); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/DependentPhoneNumber.php b/vendor/twilio-php-master/Services/Twilio/Rest/DependentPhoneNumber.php deleted file mode 100644 index a9402d0..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/DependentPhoneNumber.php +++ /dev/null @@ -1,6 +0,0 @@ -setupSubresources( - 'ip_access_control_list_mappings', - 'credential_list_mappings' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Domains.php b/vendor/twilio-php-master/Services/Twilio/Rest/Domains.php deleted file mode 100644 index 041c080..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Domains.php +++ /dev/null @@ -1,28 +0,0 @@ -account->sip->domains->create( - * "MyFriendlyName", "MyDomainName" - * ); - * - * :param string $friendly_name: the friendly name of this domain - * :param string $domain_name: the domain name for this domain - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($friendly_name, $domain_name, $params = array()) { - return parent::_create(array( - 'FriendlyName' => $friendly_name, - 'DomainName' => $domain_name, - ) + $params); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Feedback.php b/vendor/twilio-php-master/Services/Twilio/Rest/Feedback.php deleted file mode 100644 index ed210f6..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Feedback.php +++ /dev/null @@ -1,34 +0,0 @@ -instance_name = "Services_Twilio_Rest_Feedback"; - return parent::__construct($client, $uri, $params); - } - - /** - * Create feedback for the parent call - */ - public function create(array $params = array()) { - $params = $this->client->createData($this->uri, $params); - return new $this->instance_name($this->client, $this->uri, $params); - } - - /** - * Delete feedback for the parent call - */ - public function delete() { - $this->client->deleteData($this->uri); - } - - /** - * Fetch the feedback for the parent call - */ - public function get() { - return new $this->instance_name( - $this->client, $this->uri - ); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/FeedbackSummary.php b/vendor/twilio-php-master/Services/Twilio/Rest/FeedbackSummary.php deleted file mode 100644 index e6e49e0..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/FeedbackSummary.php +++ /dev/null @@ -1,33 +0,0 @@ -instance_name = "Services_Twilio_Rest_FeedbackSummary"; - return parent::__construct($client, $uri, $params); - } - - /** - * Create feedback summary for calls - */ - public function create(array $params = array()) { - $params = $this->client->createData($this->uri, $params); - return new $this->instance_name($this->client, $this->uri, $params); - } - - /** - * Delete a feedback summary - */ - public function delete($sid) { - $this->client->deleteData($this->uri . '/' . $sid); - } - - /** - * Get a feedback summary - */ - public function get($sid) { - return new $this->instance_name( - $this->client, $this->uri . '/' . $sid - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumber.php b/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumber.php deleted file mode 100644 index 37658fa..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumber.php +++ /dev/null @@ -1,95 +0,0 @@ -`_ - * documentation. - * - * .. php:attr:: sid - * - * A 34 character string that uniquely idetifies this resource. - * - * .. php:attr:: date_created - * - * The date that this resource was created, given as GMT RFC 2822 format. - * - * .. php:attr:: date_updated - * - * The date that this resource was last updated, given as GMT RFC 2822 format. - * - * .. php:attr:: friendly_name - * - * 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. - * - * .. php:attr:: account_sid - * - * The unique id of the Account responsible for this phone number. - * - * .. php:attr:: phone_number - * - * The incoming phone number. e.g., +16175551212 (E.164 format) - * - * .. php:attr:: api_version - * - * Calls to this phone number will start a new TwiML session with this - * API version. - * - * .. php:attr:: voice_caller_id_lookup - * - * Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either true or false. - * - * .. php:attr:: voice_url - * - * The URL Twilio will request when this phone number receives a call. - * - * .. php:attr:: voice_method - * - * The HTTP method Twilio will use when requesting the above Url. Either GET or POST. - * - * .. php:attr:: voice_fallback_url - * - * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url. - * - * .. php:attr:: voice_fallback_method - * - * The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST. - * - * .. php:attr:: status_callback - * - * The URL that Twilio will request to pass status parameters (such as call ended) to your application. - * - * .. php:attr:: status_callback_method - * - * The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. - * - * .. php:attr:: sms_url - * - * The URL Twilio will request when receiving an incoming SMS message to this number. - * - * .. php:attr:: sms_method - * - * The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST. - * - * .. php:attr:: sms_fallback_url - * - * The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. - * - * .. php:attr:: sms_fallback_method - * - * The HTTP method Twilio will use when requesting the above URL. Either GET or POST. - * - * .. php:attr:: beta - * - * Whether this number is new to Twilio's inventory. - * - * .. php:attr:: uri - * - * The URI for this resource, relative to https://api.twilio.com. - */ -class Services_Twilio_Rest_IncomingPhoneNumber - extends Services_Twilio_InstanceResource -{ -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumbers.php b/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumbers.php deleted file mode 100644 index 48ce4ca..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IncomingPhoneNumbers.php +++ /dev/null @@ -1,59 +0,0 @@ -`_ - * documentation at twilio.com. - */ -class Services_Twilio_Rest_IncomingPhoneNumbers extends Services_Twilio_ListResource { - function init($client, $uri) { - $this->setupSubresources( - 'local', - 'toll_free', - 'mobile' - ); - } - - function create(array $params = array()) { - return parent::_create($params); - } - - function getList($type, array $params = array()) - { - return $this->client->retrieveData($this->uri . "/$type", $params); - } - - /** - * Return a phone number instance from its E.164 representation. If more - * than one number matches the search string, returns the first one. - * - * Example usage: - * - * .. code-block:: php - * - * $number = $client->account->incoming_phone_numbers->getNumber('+14105551234'); - * echo $number->sid; - * - * :param string $number: The number in E.164 format, eg "+684105551234" - * :return: A :php:class:`Services_Twilio_Rest_IncomingPhoneNumber` object, or null - * :raises: a A :php:class:`Services_Twilio_RestException` if the number is - * invalid, not provided in E.164 format or for any other API exception. - */ - public function getNumber($number) { - $page = $this->getPage(0, 1, array( - 'PhoneNumber' => $number - )); - $items = $page->getItems(); - if (is_null($items) || empty($items)) { - return null; - } - return $items[0]; - } -} - -class Services_Twilio_Rest_Local extends Services_Twilio_NumberType { } - -class Services_Twilio_Rest_Mobile extends Services_Twilio_NumberType { } - -class Services_Twilio_Rest_TollFree extends Services_Twilio_NumberType { } diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlList.php b/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlList.php deleted file mode 100644 index 5ba83f3..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlList.php +++ /dev/null @@ -1,40 +0,0 @@ -setupSubresources( - 'ip_addresses' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMapping.php b/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMapping.php deleted file mode 100644 index ce5bc5a..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMapping.php +++ /dev/null @@ -1,37 +0,0 @@ -setupSubresources( - 'ip_addresses' - ); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMappings.php b/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMappings.php deleted file mode 100644 index f58e1b9..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlListMappings.php +++ /dev/null @@ -1,25 +0,0 @@ -account->sip->domains->get('SDXXX')->ip_access_control_list_mappings->create("ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - * - * :param string $ip_access_control_list_sid: the sid of the IpAccessControList - * you're adding to this domain. - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($ip_access_control_list_sid, $params = array()) { - return parent::_create(array( - 'IpAccessControlListSid' => $ip_access_control_list_sid, - ) + $params); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlLists.php b/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlLists.php deleted file mode 100644 index 88b9d14..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IpAccessControlLists.php +++ /dev/null @@ -1,27 +0,0 @@ -account->sip->ip_access_control_lists->create("MyFriendlyName"); - * - * :param string $friendly_name: the friendly name of this ip access control list - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * :return: the created list - * :rtype: :class:`Services_Twilio_Rest_IpAccessControlList` - * - */ - public function create($friendly_name, $params = array()) { - return parent::_create(array( - 'FriendlyName' => $friendly_name, - ) + $params); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/IpAddress.php b/vendor/twilio-php-master/Services/Twilio/Rest/IpAddress.php deleted file mode 100644 index 38b716e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/IpAddress.php +++ /dev/null @@ -1,34 +0,0 @@ -instance_name = "Services_Twilio_Rest_IpAddress"; - parent::__construct($client, $uri); - } - - /** - * Creates a new IpAddress instance - * - * Example usage: - * - * .. code-block:: php - * - * $client->account->sip->ip_access_control_lists->get('ALXXX')->ip_addresses->create( - * "FriendlyName", "127.0.0.1" - * ); - * - * :param string $friendly_name: the friendly name for the new IpAddress object - * :param string $ip_address: the ip address for the new IpAddress object - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - */ - public function create($friendly_name, $ip_address, $params = array()) { - return parent::_create(array( - 'FriendlyName' => $friendly_name, - 'IpAddress' => $ip_address, - ) + $params); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Key.php b/vendor/twilio-php-master/Services/Twilio/Rest/Key.php deleted file mode 100644 index 4750f5b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Key.php +++ /dev/null @@ -1,5 +0,0 @@ -` objects. - * For the definitive reference, see the `Twilio Media List Documentation - * `_. - */ -class Services_Twilio_Rest_Media extends Services_Twilio_ListResource { - - - // This is overridden because the list key in the Twilio response - // is "media_list", not "media". - public function getResourceName($camelized = false) - { - if ($camelized) { - return "MediaList"; - } else { - return "media_list"; - } - } - - // We manually set the instance name here so that the parent - // constructor doesn't attempt to figure out it. It would do it - // incorrectly because we override getResourceName above. - public function __construct($client, $uri) { - $this->instance_name = "Services_Twilio_Rest_MediaInstance"; - parent::__construct($client, $uri); - } - -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/MediaInstance.php b/vendor/twilio-php-master/Services/Twilio/Rest/MediaInstance.php deleted file mode 100644 index 1a152b2..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/MediaInstance.php +++ /dev/null @@ -1,37 +0,0 @@ -`_. - * - * .. php:attr:: sid - * - * A 34 character string that identifies this object - * - * .. php:attr:: account_sid - * - * A 34 character string representing the account that sent the message - * - * .. php:attr:: parent_sid - * - * The sid of the message that created this media. - * - * .. php:attr:: date_created - * - * The date the message was created - * - * .. php:attr:: date_updated - * - * The date the message was updated - * - * .. php:attr:: content_type - * - * The content-type of the media. - */ -class Services_Twilio_Rest_MediaInstance extends Services_Twilio_InstanceResource { - public function __construct($client, $uri) { - $uri = str_replace('MediaInstance', 'Media', $uri); - parent::__construct($client, $uri); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Member.php b/vendor/twilio-php-master/Services/Twilio/Rest/Member.php deleted file mode 100644 index 8067cdd..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Member.php +++ /dev/null @@ -1,22 +0,0 @@ - $url, - 'Method' => $method, - )); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Members.php b/vendor/twilio-php-master/Services/Twilio/Rest/Members.php deleted file mode 100644 index 61e05de..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Members.php +++ /dev/null @@ -1,28 +0,0 @@ -instance_name($this->client, $this->uri . '/Front'); - } - - /* Participants are identified by CallSid, not like ME123 */ - public function getObjectFromJson($params, $idParam = 'sid') { - return parent::getObjectFromJson($params, 'call_sid'); - } - - public function getResourceName($camelized = false) - { - // The JSON property name is atypical. - return $camelized ? 'Members' : 'queue_members'; - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Message.php b/vendor/twilio-php-master/Services/Twilio/Rest/Message.php deleted file mode 100644 index 2ca32e8..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Message.php +++ /dev/null @@ -1,68 +0,0 @@ -setupSubresources( - 'media' - ); - } - - public function redact() { - $postParams = array('Body' => ''); - self::update($postParams); - } - - /** - * Make a request to delete the specified resource. - * - * :rtype: boolean - */ - public function delete() - { - return $this->client->deleteData($this->uri); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Messages.php b/vendor/twilio-php-master/Services/Twilio/Rest/Messages.php deleted file mode 100644 index 355fce0..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Messages.php +++ /dev/null @@ -1,73 +0,0 @@ -account->messages->create(array( - * "Body" => "foo", - * "From" => "+14105551234", - * "To" => "+14105556789", - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. You may find it easier to use the - * sendMessage helper instead of this function. - * - */ - public function create($params = array()) { - return parent::_create($params); - } - - /** - * Send a message - * - * .. code-block:: php - * - * $client = new Services_Twilio('AC123', '123'); - * $message = $client->account->messages->sendMessage( - * '+14105551234', // From a Twilio number in your account - * '+14105556789', // Text any number - * 'Come at the king, you best not miss.' // Message body (if any) - * array('https://demo.twilio.com/owl.png'), // An array of MediaUrls - * ); - * - * :param string $from: the from number for the message, this must be a - * number you purchased from Twilio - * :param string $to: the message recipient's phone number - * :param $mediaUrls: the URLs of images to send in this MMS - * :type $mediaUrls: null (don't include media), a single URL, or an array - * of URLs to send as media with this message - * :param string $body: the text to include along with this MMS - * :param array $params: Any additional params (callback, etc) you'd like to - * send with this request, these are serialized and sent as POST - * parameters - * - * :return: The created :class:`Services_Twilio_Rest_Message` - * :raises: :class:`Services_Twilio_RestException` - * An exception if the parameters are invalid (for example, the from - * number is not a Twilio number registered to your account, or is - * unable to send MMS) - */ - public function sendMessage($from, $to, $body = null, $mediaUrls = null, - $params = array() - ) { - $postParams = array( - 'From' => $from, - 'To' => $to, - ); - // When the request is made, this will get serialized into MediaUrl=a&MediaUrl=b - if (!is_null($mediaUrls)) { - $postParams['MediaUrl'] = $mediaUrls; - } - if (!is_null($body)) { - $postParams['Body'] = $body; - } - return self::create($postParams + $params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Monitor/Alert.php b/vendor/twilio-php-master/Services/Twilio/Rest/Monitor/Alert.php deleted file mode 100644 index 31bc1b4..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Monitor/Alert.php +++ /dev/null @@ -1,5 +0,0 @@ - $phoneNumber, - ) + $params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Participant.php b/vendor/twilio-php-master/Services/Twilio/Rest/Participant.php deleted file mode 100644 index b62920b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Participant.php +++ /dev/null @@ -1,10 +0,0 @@ -update('Muted', 'true'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Participants.php b/vendor/twilio-php-master/Services/Twilio/Rest/Participants.php deleted file mode 100644 index 3b0464e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Participants.php +++ /dev/null @@ -1,10 +0,0 @@ -instance_name = "Services_Twilio_Rest_Pricing_MessagingCountry"; - parent::__construct($client, $uri); - } - - public function get($isoCountry) { - $instance = new $this->instance_name($this->client, $this->uri . "/$isoCountry"); - $instance->iso_country = $isoCountry; - return $instance; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/MessagingCountry.php b/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/MessagingCountry.php deleted file mode 100644 index e39cc4e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/MessagingCountry.php +++ /dev/null @@ -1,5 +0,0 @@ -instance_name = 'Services_Twilio_Rest_Pricing_PhoneNumberCountry'; - parent::__construct($client, $uri); - } - - public function getResourceName($camelized = false) { - if ($camelized) { - return 'Countries'; - } - return 'countries'; - } - - public function get($isoCountry) { - $instance = new $this->instance_name($this->client, $this->uri . "/$isoCountry"); - $instance->iso_country = $isoCountry; - return $instance; - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/PhoneNumberCountry.php b/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/PhoneNumberCountry.php deleted file mode 100644 index ac840b8..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/PhoneNumberCountry.php +++ /dev/null @@ -1,4 +0,0 @@ -instance_name = "Services_Twilio_Rest_Pricing_VoiceCountry"; - parent::__construct($client, $uri); - } - - public function get($isoCountry) { - $instance = new $this->instance_name($this->client, $this->uri . "/$isoCountry"); - $instance->iso_country = $isoCountry; - return $instance; - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/VoiceCountry.php b/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/VoiceCountry.php deleted file mode 100644 index 5252694..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Pricing/VoiceCountry.php +++ /dev/null @@ -1,5 +0,0 @@ -instance_name($this->client, $this->uri . "/$number"); - $instance->number = $number; - return $instance; - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Queue.php b/vendor/twilio-php-master/Services/Twilio/Rest/Queue.php deleted file mode 100644 index fa0f2f7..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Queue.php +++ /dev/null @@ -1,10 +0,0 @@ -setupSubresources('members'); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Queues.php b/vendor/twilio-php-master/Services/Twilio/Rest/Queues.php deleted file mode 100644 index bc35c83..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Queues.php +++ /dev/null @@ -1,19 +0,0 @@ - $friendly_name, - ) + $params); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Recording.php b/vendor/twilio-php-master/Services/Twilio/Rest/Recording.php deleted file mode 100644 index a76014c..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Recording.php +++ /dev/null @@ -1,9 +0,0 @@ -setupSubresources('transcriptions'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Recordings.php b/vendor/twilio-php-master/Services/Twilio/Rest/Recordings.php deleted file mode 100644 index 47ec0d5..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Recordings.php +++ /dev/null @@ -1,6 +0,0 @@ -setupSubresources( - 'domains', - 'ip_access_control_lists', - 'credential_lists' - ); - } - - public function getResourceName($camelized = false) { - return "SIP"; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/SmsMessage.php b/vendor/twilio-php-master/Services/Twilio/Rest/SmsMessage.php deleted file mode 100644 index 6bd3f9c..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/SmsMessage.php +++ /dev/null @@ -1,6 +0,0 @@ - $from, - 'To' => $to, - 'Body' => $body - ) + $params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activities.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activities.php deleted file mode 100644 index 9b1f90f..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activities.php +++ /dev/null @@ -1,15 +0,0 @@ -instance_name = "Services_Twilio_Rest_TaskRouter_Activity"; - parent::__construct($client, $uri); - } - - public function create($friendlyName, $available) { - $params['FriendlyName'] = $friendlyName; - $params['Available'] = $available; - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activity.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activity.php deleted file mode 100644 index 08f0633..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Activity.php +++ /dev/null @@ -1,5 +0,0 @@ -client->retrieveData($this->uri, $filters); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Task.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Task.php deleted file mode 100644 index ace660b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Task.php +++ /dev/null @@ -1,9 +0,0 @@ -setupSubresources('reservations'); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueue.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueue.php deleted file mode 100644 index 2e6fae6..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueue.php +++ /dev/null @@ -1,8 +0,0 @@ -setupSubresource('statistics'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueueStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueueStatistics.php deleted file mode 100644 index 73ce98e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueueStatistics.php +++ /dev/null @@ -1,5 +0,0 @@ -setupSubresource('statistics'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueuesStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueuesStatistics.php deleted file mode 100644 index e2b25b5..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/TaskQueuesStatistics.php +++ /dev/null @@ -1,9 +0,0 @@ -instance_name = "Services_Twilio_Rest_TaskRouter_TaskQueueStatistics"; - parent::__construct($client, $uri); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Tasks.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Tasks.php deleted file mode 100644 index d9d193b..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/Tasks.php +++ /dev/null @@ -1,11 +0,0 @@ -setupSubresource('statistics'); - $this->setupSubresources('reservations'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkerStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkerStatistics.php deleted file mode 100644 index 4c8c26a..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkerStatistics.php +++ /dev/null @@ -1,5 +0,0 @@ -setupSubresource('statistics'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkersStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkersStatistics.php deleted file mode 100644 index 95455dd..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkersStatistics.php +++ /dev/null @@ -1,5 +0,0 @@ -setupSubresource('statistics'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkflowStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkflowStatistics.php deleted file mode 100644 index 98b9693..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkflowStatistics.php +++ /dev/null @@ -1,5 +0,0 @@ -setupSubresources( - 'activities', - 'events', - 'tasks', - 'task_queues', - 'workers', - 'workflows' - ); - $this->setupSubresource('statistics'); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkspaceStatistics.php b/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkspaceStatistics.php deleted file mode 100644 index f5eae06..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/TaskRouter/WorkspaceStatistics.php +++ /dev/null @@ -1,5 +0,0 @@ -account->tokens->create(array( - * "Ttl" => 100, - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Transcription.php b/vendor/twilio-php-master/Services/Twilio/Rest/Transcription.php deleted file mode 100644 index 83c139c..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Transcription.php +++ /dev/null @@ -1,6 +0,0 @@ -trunks->get('TK123')->credential_lists->create(array( - * "CredentialListSid" => "CL1234xxxxx", - * .... - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/IpAccessControlList.php b/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/IpAccessControlList.php deleted file mode 100644 index f66eae6..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/IpAccessControlList.php +++ /dev/null @@ -1,5 +0,0 @@ -trunks->get('TK123')->ip_access_control_lists->create(array( - * "IpAccessControlListSid" => "AL1234xxxx", - * .... - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/OriginationUrl.php b/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/OriginationUrl.php deleted file mode 100644 index 0d56c78..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/OriginationUrl.php +++ /dev/null @@ -1,5 +0,0 @@ -trunks->get('TK123')->origination_urls->create(array( - * "FriendlyName" => "TestUrl", - * .... - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/PhoneNumber.php b/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/PhoneNumber.php deleted file mode 100644 index 9495f81..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/PhoneNumber.php +++ /dev/null @@ -1,5 +0,0 @@ -trunks->get('TK123')->phone_numbers->create(array( - * "PhoneNumberSid" => "PN1234xxxx" - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunk.php b/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunk.php deleted file mode 100644 index 0d93b9e..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunk.php +++ /dev/null @@ -1,13 +0,0 @@ -setupSubresources( - 'credential_lists', - 'ip_access_control_lists', - 'origination_urls', - 'phone_numbers' - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunks.php b/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunks.php deleted file mode 100644 index 9c76ef2..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/Trunking/Trunks.php +++ /dev/null @@ -1,5 +0,0 @@ -setupSubresources( - 'today', - 'yesterday', - 'all_time', - 'this_month', - 'last_month', - 'daily', - 'monthly', - 'yearly' - ); - } -} - -class Services_Twilio_Rest_Today extends Services_Twilio_TimeRangeResource { } - -class Services_Twilio_Rest_Yesterday extends Services_Twilio_TimeRangeResource { } - -class Services_Twilio_Rest_LastMonth extends Services_Twilio_TimeRangeResource { } - -class Services_Twilio_Rest_ThisMonth extends Services_Twilio_TimeRangeResource { } - -class Services_Twilio_Rest_AllTime extends Services_Twilio_TimeRangeResource { } - -class Services_Twilio_Rest_Daily extends Services_Twilio_UsageResource { } - -class Services_Twilio_Rest_Monthly extends Services_Twilio_UsageResource { } - -class Services_Twilio_Rest_Yearly extends Services_Twilio_UsageResource { } diff --git a/vendor/twilio-php-master/Services/Twilio/Rest/UsageTrigger.php b/vendor/twilio-php-master/Services/Twilio/Rest/UsageTrigger.php deleted file mode 100644 index 44c8cf5..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Rest/UsageTrigger.php +++ /dev/null @@ -1,5 +0,0 @@ -`_. - * @param string $value Fire the trigger when usage crosses this value. - * @param string $url The URL to request when the trigger fires. - * @param array $params Optional parameters for this trigger. A full list of parameters can be found in the `Usage Trigger documentation `_. - * @return Services_Twilio_Rest_UsageTrigger The created trigger - */ - function create($category, $value, $url, array $params = array()) { - return parent::_create(array( - 'UsageCategory' => $category, - 'TriggerValue' => $value, - 'CallbackUrl' => $url, - ) + $params); - } - -} - diff --git a/vendor/twilio-php-master/Services/Twilio/RestException.php b/vendor/twilio-php-master/Services/Twilio/RestException.php deleted file mode 100644 index c7de16c..0000000 --- a/vendor/twilio-php-master/Services/Twilio/RestException.php +++ /dev/null @@ -1,44 +0,0 @@ -status = $status; - $this->info = $info; - parent::__construct($message, $code); - } - - /** - * Get the HTTP status code - */ - public function getStatus() { - return $this->status; - } - - /** - * Get a link to more information - */ - public function getInfo() { - return $this->info; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/SIPListResource.php b/vendor/twilio-php-master/Services/Twilio/SIPListResource.php deleted file mode 100644 index 1e63b67..0000000 --- a/vendor/twilio-php-master/Services/Twilio/SIPListResource.php +++ /dev/null @@ -1,14 +0,0 @@ -subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } - - protected function setupSubresource($name) { - $constantized = ucfirst(self::camelize($name)); - $type = get_class($this) . $constantized; - $this->subresources[$name] = new $type( - $this->client, $this->uri . "/". $constantized - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/TaskRouterListResource.php b/vendor/twilio-php-master/Services/Twilio/TaskRouterListResource.php deleted file mode 100644 index 156e190..0000000 --- a/vendor/twilio-php-master/Services/Twilio/TaskRouterListResource.php +++ /dev/null @@ -1,26 +0,0 @@ -getResourceName(true); - /* - * By default trim the 's' from the end of the list name to get the - * instance name (ex Accounts -> Account). This behavior can be - * overridden by child classes if the rule doesn't work. - */ - if (!isset($this->instance_name)) { - $this->instance_name = "Services_Twilio_Rest_TaskRouter_" . rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } - - protected function setupSubresource($name) { - $constantized = ucfirst(self::camelize($name)); - $type = get_class($this) . $constantized; - $this->subresources[$name] = new $type( - $this->client, $this->uri . "/". $constantized - ); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/TimeRangeResource.php b/vendor/twilio-php-master/Services/Twilio/TimeRangeResource.php deleted file mode 100644 index ebf1990..0000000 --- a/vendor/twilio-php-master/Services/Twilio/TimeRangeResource.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -class Services_Twilio_TimeRangeResource extends Services_Twilio_UsageResource { - - /** - * Return a UsageRecord corresponding to the given category. - * - * @param string $category The category of usage to retrieve. For a full - * list of valid categories, please see the documentation at - * http://www.twilio.com/docs/api/rest/usage-records#usage-all-categories - * @return Services_Twilio_Rest_UsageRecord - * @throws Services_Twilio_RestException - */ - public function getCategory($category) { - $page = $this->getPage(0, 1, array( - 'Category' => $category, - )); - $items = $page->getItems(); - if (!is_array($items) || count($items) === 0) { - throw new Services_Twilio_RestException( - 400, "Usage record data is unformattable."); - } - return $items[0]; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/TinyHttp.php b/vendor/twilio-php-master/Services/Twilio/TinyHttp.php deleted file mode 100644 index b6ccfe2..0000000 --- a/vendor/twilio-php-master/Services/Twilio/TinyHttp.php +++ /dev/null @@ -1,134 +0,0 @@ - array( - * CURLOPT_USERAGENT => self::USER_AGENT, - * CURLOPT_HTTPHEADER => array('Accept-Charset: utf-8'), - * CURLOPT_CAINFO => dirname(__FILE__) . '/cacert.pem', - * )) - * ); - */ -class Services_Twilio_TinyHttp { - var $user, $pass, $scheme, $host, $port, $debug, $curlopts; - - public function __construct($uri = '', $kwargs = array()) { - foreach (parse_url($uri) as $name => $value) $this->$name = $value; - $this->debug = isset($kwargs['debug']) ? !!$kwargs['debug'] : NULL; - $this->curlopts = isset($kwargs['curlopts']) ? $kwargs['curlopts'] : array(); - } - - public function __call($name, $args) { - list($res, $req_headers, $req_body) = $args + array(0, array(), ''); - - if (strpos($res, 'http') === 0) { - // We got handed a complete URL, just use it - $url = $res; - } else { - // Build from path and default scheme/host. - $url = "$this->scheme://$this->host$res"; - } - - $opts = $this->curlopts + array( - CURLOPT_URL => $url, - CURLOPT_HEADER => TRUE, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_INFILESIZE => -1, - CURLOPT_POSTFIELDS => NULL, - CURLOPT_TIMEOUT => 60, - ); - - foreach ($req_headers as $k => $v) $opts[CURLOPT_HTTPHEADER][] = "$k: $v"; - if ($this->port) $opts[CURLOPT_PORT] = $this->port; - if ($this->debug) $opts[CURLINFO_HEADER_OUT] = TRUE; - if ($this->user && $this->pass) $opts[CURLOPT_USERPWD] = "$this->user:$this->pass"; - switch ($name) { - case 'get': - $opts[CURLOPT_HTTPGET] = TRUE; - break; - case 'post': - $opts[CURLOPT_POST] = TRUE; - $opts[CURLOPT_POSTFIELDS] = $req_body; - break; - case 'put': - $opts[CURLOPT_PUT] = TRUE; - if (strlen($req_body)) { - if ($buf = fopen('php://memory', 'w+')) { - fwrite($buf, $req_body); - fseek($buf, 0); - $opts[CURLOPT_INFILE] = $buf; - $opts[CURLOPT_INFILESIZE] = strlen($req_body); - } else throw new Services_Twilio_TinyHttpException('unable to open temporary file'); - } - break; - case 'head': - $opts[CURLOPT_NOBODY] = TRUE; - break; - default: - $opts[CURLOPT_CUSTOMREQUEST] = strtoupper($name); - break; - } - try { - if ($curl = curl_init()) { - if (curl_setopt_array($curl, $opts)) { - if ($response = curl_exec($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]); - $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); - if ($this->debug) { - error_log( - curl_getinfo($curl, CURLINFO_HEADER_OUT) . - $req_body - ); - } - $header_lines = explode("\r\n", $head); - array_shift($header_lines); - foreach ($header_lines as $line) { - list($key, $value) = explode(":", $line, 2); - $headers[$key] = trim($value); - } - curl_close($curl); - if (isset($buf) && is_resource($buf)) { - fclose($buf); - } - return array($status, $headers, $body); - } else { - throw new Services_Twilio_TinyHttpException(curl_error($curl)); - } - } else throw new Services_Twilio_TinyHttpException(curl_error($curl)); - } else throw new Services_Twilio_TinyHttpException('unable to initialize cURL'); - } catch (ErrorException $e) { - if (is_resource($curl)) curl_close($curl); - if (isset($buf) && is_resource($buf)) fclose($buf); - throw $e; - } - } - - public function authenticate($user, $pass) { - $this->user = $user; - $this->pass = $pass; - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/TrunkingInstanceResource.php b/vendor/twilio-php-master/Services/Twilio/TrunkingInstanceResource.php deleted file mode 100644 index 505fe94..0000000 --- a/vendor/twilio-php-master/Services/Twilio/TrunkingInstanceResource.php +++ /dev/null @@ -1,15 +0,0 @@ -subresources[$name] = new $type( - $this->client, $this->uri . "/$constantized" - ); - } - } - -} diff --git a/vendor/twilio-php-master/Services/Twilio/TrunkingListResource.php b/vendor/twilio-php-master/Services/Twilio/TrunkingListResource.php deleted file mode 100644 index dc51ede..0000000 --- a/vendor/twilio-php-master/Services/Twilio/TrunkingListResource.php +++ /dev/null @@ -1,38 +0,0 @@ -getResourceName(true); - /* - * By default trim the 's' from the end of the list name to get the - * instance name (ex Accounts -> Account). This behavior can be - * overridden by child classes if the rule doesn't work. - */ - if (!isset($this->instance_name)) { - $this->instance_name = "Services_Twilio_Rest_Trunking_" . rtrim($name, 's'); - } - - parent::__construct($client, $uri); - } - - /** - * Create a new Trunk instance - * - * Example usage: - * - * .. code-block:: php - * - * $trunkingClient->trunks->create(array( - * "FriendlyName" => "TestTrunk", - * "DomainName" => "test.pstn.twilio.com" - * )); - * - * :param array $params: a single array of parameters which is serialized and - * sent directly to the Twilio API. - * - */ - public function create($params = array()) { - return parent::_create($params); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/Twiml.php b/vendor/twilio-php-master/Services/Twilio/Twiml.php deleted file mode 100644 index 6a021ca..0000000 --- a/vendor/twilio-php-master/Services/Twilio/Twiml.php +++ /dev/null @@ -1,137 +0,0 @@ - - * License: http://creativecommons.org/licenses/MIT/ MIT - */ -class Services_Twilio_Twiml { - - protected $element; - - /** - * Constructs a Twiml response. - * - * :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(''); - break; - case is_array($arg): - $this->element = new SimpleXmlElement(''); - foreach ($arg as $name => $value) { - $this->element->addAttribute($name, $value); - } - break; - default: - throw new Services_Twilio_TwimlException('Invalid argument'); - } - } - - /** - * Converts method calls into Twiml verbs. - * - * A basic example: - * - * .. code-block:: php - * - * php> print $this->say('hello'); - * hello - * - * An example with attributes: - * - * .. code-block:: php - * - * print $this->say('hello', array('voice' => 'woman')); - * hello - * - * You could even just pass in an attributes array, omitting the noun: - * - * .. code-block:: php - * - * print $this->gather(array('timeout' => '20')); - * - * - * :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); - $child = empty($noun) - ? $this->element->addChild(ucfirst($verb)) - : $this->element->addChild(ucfirst($verb), $normalized); - 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 str_replace( - '', - '', $xml); - } -} diff --git a/vendor/twilio-php-master/Services/Twilio/UsageResource.php b/vendor/twilio-php-master/Services/Twilio/UsageResource.php deleted file mode 100644 index b9b929c..0000000 --- a/vendor/twilio-php-master/Services/Twilio/UsageResource.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @license http://creativecommons.org/licenses/MIT/ MIT - * @link http://pear.php.net/package/Services_Twilio - */ -class Services_Twilio_UsageResource extends Services_Twilio_ListResource { - public function getResourceName($camelized = false) { - $this->instance_name = 'Services_Twilio_Rest_UsageRecord'; - return $camelized ? 'UsageRecords' : 'usage_records'; - } - - public function __construct($client, $uri) { - $uri = preg_replace("#UsageRecords#", "Usage/Records", $uri); - parent::__construct($client, $uri); - } -} - diff --git a/vendor/twilio-php-master/Services/Twilio/WorkflowConfiguration.php b/vendor/twilio-php-master/Services/Twilio/WorkflowConfiguration.php deleted file mode 100644 index 1d26b4a..0000000 --- a/vendor/twilio-php-master/Services/Twilio/WorkflowConfiguration.php +++ /dev/null @@ -1,88 +0,0 @@ -filters = $filters; - $this->default_filter = $default_filter; - } - - public function toJSON() { - return json_encode($this); - } - - public static function parse($json) { - return json_decode($json); - } - - 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; - } -} - -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; - } -} - -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; - } -} \ No newline at end of file diff --git a/vendor/twilio-php-master/composer.json b/vendor/twilio-php-master/composer.json deleted file mode 100644 index 8f9234e..0000000 --- a/vendor/twilio-php-master/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "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": "Kevin Burke", - "email": "kevin@twilio.com" - }, - { - "name": "Kyle Conroy", - "email": "kyle+pear@twilio.com" - } - ], - "require": { - "php": ">=5.2.1" - }, - "require-dev": { - "mockery/mockery": ">=0.7.2", - "phpunit/phpunit": "4.5.*" - }, - "autoload": { - "files": ["Services/Twilio.php"] - } -} diff --git a/vendor/twilio-php-master/composer.lock b/vendor/twilio-php-master/composer.lock deleted file mode 100644 index 1d64070..0000000 --- a/vendor/twilio-php-master/composer.lock +++ /dev/null @@ -1,1034 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" - ], - "hash": "ca1df82a4767767bb8db854f08fceb9c", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2014-10-13 12:58:55" - }, - { - "name": "mockery/mockery", - "version": "0.9.3", - "source": { - "type": "git", - "url": "https://github.com/padraic/mockery.git", - "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", - "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", - "shasum": "" - }, - "require": { - "lib-pcre": ">=7.0", - "php": ">=5.3.2" - }, - "require-dev": { - "hamcrest/hamcrest-php": "~1.1", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "~0.7@dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2014-12-22 10:06:19" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/9ca52329bcdd1500de24427542577ebf3fc2f1c9", - "reference": "9ca52329bcdd1500de24427542577ebf3fc2f1c9", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "phpdocumentor/reflection-docblock": "~2.0" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "http://phpspec.org", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2014-11-17 16:23:49" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.0.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", - "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2015-01-24 10:06:35" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.3.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", - "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "File/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2013-10-10 15:34:57" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "Text/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2014-01-30 17:20:04" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1.0.5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1.0.5", - "reference": "1.0.5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "PHP/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2013-08-02 07:42:54" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", - "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2015-01-17 09:51:32" - }, - { - "name": "phpunit/phpunit", - "version": "4.5.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5b578d3865a9128b9c209b011fda6539ec06e7a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5b578d3865a9128b9c209b011fda6539ec06e7a5", - "reference": "5b578d3865a9128b9c209b011fda6539ec06e7a5", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3.1", - "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.2", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.1", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.5.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2015-02-05 15:51:19" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "c63d2367247365f688544f0d500af90a11a44c65" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", - "reference": "c63d2367247365f688544f0d500af90a11a44c65", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "~1.0,>=1.0.1", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.3" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2014-10-03 05:12:11" - }, - { - "name": "sebastian/comparator", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-01-29 16:28:08" - }, - { - "name": "sebastian/diff", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", - "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2014-08-15 10:29:00" - }, - { - "name": "sebastian/environment", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e6c71d918088c251b181ba8b3088af4ac336dd7", - "reference": "6e6c71d918088c251b181ba8b3088af4ac336dd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2014-10-25 08:00:45" - }, - { - "name": "sebastian/exporter", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-01-27 07:23:06" - }, - { - "name": "sebastian/global-state", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2014-10-06 09:23:50" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" - }, - { - "name": "sebastian/version", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", - "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-12-15 14:25:24" - }, - { - "name": "symfony/yaml", - "version": "v2.6.4", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", - "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2015-01-25 04:39:26" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "platform": { - "php": ">=5.2.1" - }, - "platform-dev": [] -} diff --git a/vendor/twilio-php-master/docs/Makefile b/vendor/twilio-php-master/docs/Makefile deleted file mode 100644 index d5756c7..0000000 --- a/vendor/twilio-php-master/docs/Makefile +++ /dev/null @@ -1,130 +0,0 @@ -# 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) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest - -help: - @echo "Please use \`make ' where 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 " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @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 " text to make text files" - @echo " man to make manual pages" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -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." - -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/Services_Twilio.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Services_Twilio.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Services_Twilio" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Services_Twilio" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -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)." - -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." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -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." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/vendor/twilio-php-master/docs/_themes/.gitignore b/vendor/twilio-php-master/docs/_themes/.gitignore deleted file mode 100644 index 66b6e4c..0000000 --- a/vendor/twilio-php-master/docs/_themes/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pyc -*.pyo -.DS_Store diff --git a/vendor/twilio-php-master/docs/_themes/LICENSE b/vendor/twilio-php-master/docs/_themes/LICENSE deleted file mode 100644 index b160a8e..0000000 --- a/vendor/twilio-php-master/docs/_themes/LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -Modifications: - -Copyright (c) 2011 Kenneth Reitz. - - -Original Project: - -Copyright (c) 2010 by Armin Ronacher. - - -Some rights reserved. - -Redistribution and use in source and binary forms of the theme, with or -without modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -* The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -We kindly ask you to only use these themes in an unmodified manner just -for Flask and Flask-related products, not for unrelated projects. If you -like the visual style and want to use it for your own projects, please -consider making some larger changes to the themes (such as changing -font faces, sizes, colors or margins). - -THIS THEME 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 THEME, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/twilio-php-master/docs/_themes/README.rst b/vendor/twilio-php-master/docs/_themes/README.rst deleted file mode 100644 index 8648482..0000000 --- a/vendor/twilio-php-master/docs/_themes/README.rst +++ /dev/null @@ -1,25 +0,0 @@ -krTheme Sphinx Style -==================== - -This repository contains sphinx styles Kenneth Reitz uses in most of -his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. - -2. add this to your conf.py: :: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'flask' - -The following themes exist: - -**kr** - the standard flask documentation theme for large projects - -**kr_small** - small one-page theme. Intended to be used by very small addon libraries. - diff --git a/vendor/twilio-php-master/docs/_themes/flask_theme_support.py b/vendor/twilio-php-master/docs/_themes/flask_theme_support.py deleted file mode 100644 index 33f4744..0000000 --- a/vendor/twilio-php-master/docs/_themes/flask_theme_support.py +++ /dev/null @@ -1,86 +0,0 @@ -# flasky extensions. flasky pygments style based on tango style -from pygments.style import Style -from pygments.token import Keyword, Name, Comment, String, Error, \ - Number, Operator, Generic, Whitespace, Punctuation, Other, Literal - - -class FlaskyStyle(Style): - background_color = "#f8f8f8" - default_style = "" - - styles = { - # No corresponding class for the following: - #Text: "", # class: '' - Whitespace: "underline #f8f8f8", # class: 'w' - Error: "#a40000 border:#ef2929", # class: 'err' - Other: "#000000", # class 'x' - - Comment: "italic #8f5902", # class: 'c' - Comment.Preproc: "noitalic", # class: 'cp' - - Keyword: "bold #004461", # class: 'k' - Keyword.Constant: "bold #004461", # class: 'kc' - Keyword.Declaration: "bold #004461", # class: 'kd' - Keyword.Namespace: "bold #004461", # class: 'kn' - Keyword.Pseudo: "bold #004461", # class: 'kp' - Keyword.Reserved: "bold #004461", # class: 'kr' - Keyword.Type: "bold #004461", # class: 'kt' - - Operator: "#582800", # class: 'o' - Operator.Word: "bold #004461", # class: 'ow' - like keywords - - Punctuation: "bold #000000", # class: 'p' - - # because special names such as Name.Class, Name.Function, etc. - # are not recognized as such later in the parsing, we choose them - # to look the same as ordinary variables. - Name: "#000000", # class: 'n' - Name.Attribute: "#c4a000", # class: 'na' - to be revised - Name.Builtin: "#004461", # class: 'nb' - Name.Builtin.Pseudo: "#3465a4", # class: 'bp' - Name.Class: "#000000", # class: 'nc' - to be revised - Name.Constant: "#000000", # class: 'no' - to be revised - Name.Decorator: "#888", # class: 'nd' - to be revised - Name.Entity: "#ce5c00", # class: 'ni' - Name.Exception: "bold #cc0000", # class: 'ne' - Name.Function: "#000000", # class: 'nf' - Name.Property: "#000000", # class: 'py' - Name.Label: "#f57900", # class: 'nl' - Name.Namespace: "#000000", # class: 'nn' - to be revised - Name.Other: "#000000", # class: 'nx' - Name.Tag: "bold #004461", # class: 'nt' - like a keyword - Name.Variable: "#000000", # class: 'nv' - to be revised - Name.Variable.Class: "#000000", # class: 'vc' - to be revised - Name.Variable.Global: "#000000", # class: 'vg' - to be revised - Name.Variable.Instance: "#000000", # class: 'vi' - to be revised - - Number: "#990000", # class: 'm' - - Literal: "#000000", # class: 'l' - Literal.Date: "#000000", # class: 'ld' - - String: "#4e9a06", # class: 's' - String.Backtick: "#4e9a06", # class: 'sb' - String.Char: "#4e9a06", # class: 'sc' - String.Doc: "italic #8f5902", # class: 'sd' - like a comment - String.Double: "#4e9a06", # class: 's2' - String.Escape: "#4e9a06", # class: 'se' - String.Heredoc: "#4e9a06", # class: 'sh' - String.Interpol: "#4e9a06", # class: 'si' - String.Other: "#4e9a06", # class: 'sx' - String.Regex: "#4e9a06", # class: 'sr' - String.Single: "#4e9a06", # class: 's1' - String.Symbol: "#4e9a06", # class: 'ss' - - Generic: "#000000", # class: 'g' - Generic.Deleted: "#a40000", # class: 'gd' - Generic.Emph: "italic #000000", # class: 'ge' - Generic.Error: "#ef2929", # class: 'gr' - Generic.Heading: "bold #000080", # class: 'gh' - Generic.Inserted: "#00A000", # class: 'gi' - Generic.Output: "#888", # class: 'go' - Generic.Prompt: "#745334", # class: 'gp' - Generic.Strong: "bold #000000", # class: 'gs' - Generic.Subheading: "bold #800080", # class: 'gu' - Generic.Traceback: "bold #a40000", # class: 'gt' - } diff --git a/vendor/twilio-php-master/docs/_themes/kr/layout.html b/vendor/twilio-php-master/docs/_themes/kr/layout.html deleted file mode 100644 index 7dfedb1..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr/layout.html +++ /dev/null @@ -1,32 +0,0 @@ -{%- extends "basic/layout.html" %} -{%- block extrahead %} - {{ super() }} - {% if theme_touch_icon %} - - {% endif %} - -{% endblock %} -{%- block relbar2 %}{% endblock %} -{%- block footer %} - - - - Fork me on GitHub - - -{%- endblock %} diff --git a/vendor/twilio-php-master/docs/_themes/kr/relations.html b/vendor/twilio-php-master/docs/_themes/kr/relations.html deleted file mode 100644 index 3bbcde8..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr/relations.html +++ /dev/null @@ -1,19 +0,0 @@ -

Related Topics

- diff --git a/vendor/twilio-php-master/docs/_themes/kr/static/flasky.css_t b/vendor/twilio-php-master/docs/_themes/kr/static/flasky.css_t deleted file mode 100644 index aa3e8eb..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr/static/flasky.css_t +++ /dev/null @@ -1,469 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. Modifications by Kenneth Reitz. - * :license: Flask Design License, see LICENSE for details. - */ - -{% set page_width = '940px' %} -{% set sidebar_width = '220px' %} - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro'; - font-size: 17px; - background-color: white; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - width: {{ page_width }}; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 {{ sidebar_width }}; -} - -div.sphinxsidebar { - width: {{ sidebar_width }}; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - width: {{ page_width }}; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -div.related { - display: none; -} - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebar { - font-size: 14px; - line-height: 1.5; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0; - margin: -10px 0 0 -20px; - text-align: center; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: 'Georgia', serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #ddd; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition tt.xref, div.admonition a tt { - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; - background: #fdfdfd; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td.label { - width: 0px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #eee; - padding: 7px 30px; - margin: 15px -30px; - line-height: 1.3em; -} - -dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid white; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt { - background: #EEE; -} - - -@media screen and (max-width: 600px) { - - div.sphinxsidebar { - display: none; - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - .document { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - - -} - - -/* scrollbars */ - -::-webkit-scrollbar { - width: 6px; - height: 6px; -} - -::-webkit-scrollbar-button:start:decrement, -::-webkit-scrollbar-button:end:increment { - display: block; - height: 10px; -} - -::-webkit-scrollbar-button:vertical:increment { - background-color: #fff; -} - -::-webkit-scrollbar-track-piece { - background-color: #eee; - -webkit-border-radius: 3px; -} - -::-webkit-scrollbar-thumb:vertical { - height: 50px; - background-color: #ccc; - -webkit-border-radius: 3px; -} - -::-webkit-scrollbar-thumb:horizontal { - width: 50px; - background-color: #ccc; - -webkit-border-radius: 3px; -} - -/* misc. */ - -.revsys-inline { - display: none!important; -} \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/_themes/kr/static/small_flask.css b/vendor/twilio-php-master/docs/_themes/kr/static/small_flask.css deleted file mode 100644 index 1c6df30..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr/static/small_flask.css +++ /dev/null @@ -1,70 +0,0 @@ -/* - * small_flask.css_t - * ~~~~~~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. - * :license: Flask Design License, see LICENSE for details. - */ - -body { - margin: 0; - padding: 20px 30px; -} - -div.documentwrapper { - float: none; - background: white; -} - -div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: white; -} - -div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, -div.sphinxsidebar h3 a { - color: white; -} - -div.sphinxsidebar a { - color: #aaa; -} - -div.sphinxsidebar p.logo { - display: none; -} - -div.document { - width: 100%; - margin: 0; -} - -div.related { - display: block; - margin: 0; - padding: 10px 0 20px 0; -} - -div.related ul, -div.related ul li { - margin: 0; - padding: 0; -} - -div.footer { - display: none; -} - -div.bodywrapper { - margin: 0; -} - -div.body { - min-height: 0; - padding: 0; -} diff --git a/vendor/twilio-php-master/docs/_themes/kr/theme.conf b/vendor/twilio-php-master/docs/_themes/kr/theme.conf deleted file mode 100644 index 307a1f0..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr/theme.conf +++ /dev/null @@ -1,7 +0,0 @@ -[theme] -inherit = basic -stylesheet = flasky.css -pygments_style = flask_theme_support.FlaskyStyle - -[options] -touch_icon = diff --git a/vendor/twilio-php-master/docs/_themes/kr_small/layout.html b/vendor/twilio-php-master/docs/_themes/kr_small/layout.html deleted file mode 100644 index aa1716a..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr_small/layout.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "basic/layout.html" %} -{% block header %} - {{ super() }} - {% if pagename == 'index' %} -
- {% endif %} -{% endblock %} -{% block footer %} - {% if pagename == 'index' %} -
- {% endif %} -{% endblock %} -{# do not display relbars #} -{% block relbar1 %}{% endblock %} -{% block relbar2 %} - {% if theme_github_fork %} - Fork me on GitHub - {% endif %} -{% endblock %} -{% block sidebar1 %}{% endblock %} -{% block sidebar2 %}{% endblock %} diff --git a/vendor/twilio-php-master/docs/_themes/kr_small/static/flasky.css_t b/vendor/twilio-php-master/docs/_themes/kr_small/static/flasky.css_t deleted file mode 100644 index fe2141c..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr_small/static/flasky.css_t +++ /dev/null @@ -1,287 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * Sphinx stylesheet -- flasky theme based on nature theme. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'Georgia', serif; - font-size: 17px; - color: #000; - background: white; - margin: 0; - padding: 0; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 40px auto 0 auto; - width: 700px; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 30px 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - text-align: right; - color: #888; - padding: 10px; - font-size: 14px; - width: 650px; - margin: 0 auto 40px auto; -} - -div.footer a { - color: #888; - text-decoration: underline; -} - -div.related { - line-height: 32px; - color: #888; -} - -div.related ul { - padding: 0 0 0 10px; -} - -div.related a { - color: #444; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body { - padding-bottom: 40px; /* saved for footer */ -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -{% if theme_index_logo %} -div.indexwrapper h1 { - text-indent: -999999px; - background: url({{ theme_index_logo }}) no-repeat center center; - height: {{ theme_index_logo_height }}; -} -{% endif %} - -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: white; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight{ - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.85em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td { - padding: 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -pre { - padding: 0; - margin: 15px -30px; - padding: 8px; - line-height: 1.3em; - padding: 7px 30px; - background: #eee; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; -} - -dl pre { - margin-left: -60px; - padding-left: 60px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; -} - -a:hover tt { - background: #EEE; -} diff --git a/vendor/twilio-php-master/docs/_themes/kr_small/theme.conf b/vendor/twilio-php-master/docs/_themes/kr_small/theme.conf deleted file mode 100644 index 542b462..0000000 --- a/vendor/twilio-php-master/docs/_themes/kr_small/theme.conf +++ /dev/null @@ -1,10 +0,0 @@ -[theme] -inherit = basic -stylesheet = flasky.css -nosidebar = true -pygments_style = flask_theme_support.FlaskyStyle - -[options] -index_logo = '' -index_logo_height = 120px -github_fork = '' diff --git a/vendor/twilio-php-master/docs/api/rest.rst b/vendor/twilio-php-master/docs/api/rest.rst deleted file mode 100644 index 172fa98..0000000 --- a/vendor/twilio-php-master/docs/api/rest.rst +++ /dev/null @@ -1,872 +0,0 @@ -.. _api-rest: - -############################### -Twilio Rest Resources -############################### - -************** -List Resources -************** - -.. phpautoclass:: Services_Twilio_ListResource - :filename: ../Services/Twilio/ListResource.php - :members: - -All of the below classes inherit from the :php:class:`ListResource -`. - -Accounts -=========== - -.. phpautoclass:: Services_Twilio_Rest_Accounts - :filename: ../Services/Twilio/Rest/Accounts.php - :members: - -AvailablePhoneNumbers -======================== - -.. php:class:: Services_Twilio_Rest_AvailablePhoneNumbers - - For more information, see the `AvailablePhoneNumbers API Resource `_ documentation at twilio.com. - - .. php:method:: getList($country, $type) - - Get a list of available phone numbers. - - :param string country: The 2-digit country code for numbers ('US', 'GB', - 'CA') - :param string type: The type of phone number ('TollFree' or 'Local') - :return: An instance of the :php:class:`Services_Twilio_Rest_AvailablePhoneNumbers` resource. - - .. php:attr:: available_phone_numbers - - A list of :php:class:`Services_Twilio_Rest_AvailablePhoneNumber` instances. - - .. php:attr:: uri - - The uri representing this resource, relative to https://api.twilio.com. - - -Calls -======= - -.. php:class:: Services_Twilio_Rest_Calls - - For more information, see the `Call List Resource `_ documentation. - - .. php:method:: create($from, $to, $url, params = array()) - - Make an outgoing call - - :param string $from: The phone number to use as the caller id. - :param string $to: The number to call formatted with a '+' and country code - :param string $url: The fully qualified URL that should be consulted when - the call connects. This value can also be an ApplicationSid. - :param array $params: An array of optional parameters for this call - - The **$params** array can contain the following keys: - - *Method* - The HTTP method Twilio should use when making its request to the above Url parameter's value. Defaults to POST. If an ApplicationSid parameter is present, this parameter is ignored. - - *FallbackUrl* - A URL that Twilio will request if an error occurs requesting or executing the TwiML at Url. If an ApplicationSid parameter is present, this parameter is ignored. - - *FallbackMethod* - The HTTP method that Twilio should use to request the FallbackUrl. Must be either GET or POST. Defaults to POST. If an ApplicationSid parameter is present, this parameter is ignored. - - *StatusCallback* - A URL that Twilio will request when the call ends to notify your app. If an ApplicationSid parameter is present, this parameter is ignored. - - *StatusCallbackMethod* - The HTTP method Twilio should use when requesting the above URL. Defaults to POST. If an ApplicationSid parameter is present, this parameter is ignored. - - *SendDigits* - A string of keys to dial after connecting to the number. Valid digits in the string include: any digit (0-9), '#' and '*'. For example, if you connected to a company phone number, and wanted to dial extension 1234 and then the pound key, use SendDigits=1234#. Remember to URL-encode this string, since the '#' character has special meaning in a URL. - - *IfMachine* - Tell Twilio to try and determine if a machine (like voicemail) or a human has answered the call. Possible values are Continue and Hangup. See the answering machines section below for more info. - - *Timeout* - 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. - -CredentialListMappings -========================= - -.. phpautoclass:: Services_Twilio_Rest_CredentialListMappings - :filename: ../Services/Twilio/Rest/CredentialListMappings.php - :members: - - -CredentialLists -================= - -.. phpautoclass:: Services_Twilio_Rest_CredentialLists - :filename: ../Services/Twilio/Rest/CredentialLists.php - :members: - -Credentials -============== - -.. phpautoclass:: Services_Twilio_Rest_Credentials - :filename: ../Services/Twilio/Rest/Credentials.php - :members: - -Domains -========== - -.. phpautoclass:: Services_Twilio_Rest_Domains - :filename: ../Services/Twilio/Rest/Domains.php - :members: - - -IncomingPhoneNumbers -======================== - -.. phpautoclass:: Services_Twilio_Rest_IncomingPhoneNumbers,Services_Twilio_Rest_Local,Services_Twilio_Rest_Mobile,Services_Twilio_Rest_TollFree - :filename: ../Services/Twilio/Rest/IncomingPhoneNumbers.php - :members: - -IpAccessControlListMappings -============================== - -.. phpautoclass:: Services_Twilio_Rest_IpAccessControlListMappings - :filename: ../Services/Twilio/Rest/IpAccessControlListMappings.php - :members: - -IpAccessControlLists -======================= - -.. phpautoclass:: Services_Twilio_Rest_IpAccessControlLists - :filename: ../Services/Twilio/Rest/IpAccessControlLists.php - :members: - -IpAddresses -======================= - -.. phpautoclass:: Services_Twilio_Rest_IpAddresses - :filename: ../Services/Twilio/Rest/IpAddresses.php - :members: - -Media -====== - -.. phpautoclass:: Services_Twilio_Rest_Media - :filename: ../Services/Twilio/Rest/Media.php - :members: - -Members -=========== - -.. php:class:: Services_Twilio_Rest_Members - - For more information, including a list of filter parameters, see the `Member List Resource `_ documentation. - - .. php:method:: front() - - Return the :php:class:`Services_Twilio_Rest_Member` at the front of the - queue. - -Messages -======== - -.. phpautoclass:: Services_Twilio_Rest_Messages - :filename: ../Services/Twilio/Rest/Messages.php - :members: - -Queues -=========== - -.. php:class:: Services_Twilio_Rest_Queues - - For more information, including a list of filter parameters, see the - `Queues List Resource `_ - documentation. - - .. php:method:: create($friendly_name, $params = array()) - - Create a new :php:class:`Services_Twilio_Rest_Queue`. - - :param string $friendly_name: The name of the new Queue. - :param array $params: An array of optional parameters and their values, - like `MaxSize`. - :returns: A new :php:class:`Services_Twilio_Rest_Queue` - - -UsageRecords -============== - -.. php:class:: Services_Twilio_Rest_UsageRecords - - For more information, including a list of filter parameters, see the `UsageRecords List Resource `_ documentation. - - .. php:method:: getCategory($category) - - Return the single UsageRecord corresponding to this category of usage. - Valid only for the `Records`, `Today`, `Yesterday`, `ThisMonth`, - `LastMonth` and `AllTime` resources. - - :param string $category: The category to retrieve a usage record for. For a full list of valid categories, see the full `Usage Category documentation `_. - :returns: :php:class:`Services_Twilio_Rest_UsageRecord` A single usage record - -UsageTriggers -============= - -.. php:class:: Services_Twilio_Rest_UsageTriggers - - For more information, including a list of filter parameters, see the `UsageTriggers List Resource `_ documentation. - - .. php:method:: create($category, $value, $url, $params = array()) - - Create a new UsageTrigger. - - :param string $category: The category of usage to fire a trigger for. A full list of categories can be found in the `Usage Categories documentation `_. - :param string $value: Fire the trigger when usage crosses this value. - :param string $url: The URL to request when the trigger fires. - :param array $params: Optional parameters for this trigger. A full list of parameters can be found in the `Usage Trigger documentation `_. - :returns: :php:class:`Services_Twilio_Rest_UsageTrigger` The created trigger. - - -******************** -Instance Resources -******************** - -.. phpautoclass:: Services_Twilio_InstanceResource - :filename: ../Services/Twilio/InstanceResource.php - :members: - -Below you will find a list of objects created by interacting with the Twilio -API, and the methods and properties that can be called on them. These are -derived from the :php:class:`ListResource ` and -:php:class:`InstanceResource ` above. - - -Account -======== - -.. php:class:: Services_Twilio_Rest_Account - - For more information, see the `Account Instance Resource `_ documentation. - - .. php:method:: update($params) - - Update the account - - The **$params** array is the same as in :php:meth:`Services_Twilio_Rest_Accounts::create` - - .. php:attr:: sid - - A 34 character string that uniquely identifies this account. - - .. php:attr:: date_created - - The date that this account was created, in GMT in RFC 2822 format - - .. php:attr:: date_updated - - The date that this account was last updated, in GMT in RFC 2822 format. - - .. php:attr:: friendly_name - - A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address. - - .. php:attr:: status - - The status of this account. Usually active, but can be suspended if you've been bad, or closed if you've been horrible. - - .. php:attr:: auth_token - - The authorization token for this account. This token should be kept a secret, so no sharing. - -Application -=========== - -.. php:class:: Services_Twilio_Rest_Application - - For more information, see the `Application Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely idetifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given as GMT RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given as GMT RFC 2822 format. - - .. php:attr:: friendly_name - - 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. - - .. php:attr:: account_sid - - The unique id of the Account responsible for this phone number. - - .. php:attr:: api_version - - Calls to this phone number will start a new TwiML session with this API version. - - .. php:attr:: voice_caller_id_lookup - - Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either true or false. - - .. php:attr:: voice_url - - The URL Twilio will request when this phone number receives a call. - - .. php:attr:: voice_method - - The HTTP method Twilio will use when requesting the above Url. Either GET or POST. - - .. php:attr:: voice_fallback_url - - The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url. - - .. php:attr:: voice_fallback_method - - The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST. - - .. php:attr:: status_callback - - The URL that Twilio will request to pass status parameters (such as call ended) to your application. - - .. php:attr:: status_callback_method - - The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. - - .. php:attr:: sms_url - - The URL Twilio will request when receiving an incoming SMS message to this number. - - .. php:attr:: sms_method - - The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST. - - .. php:attr:: sms_fallback_url - - The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. - - .. php:attr:: sms_fallback_method - - The HTTP method Twilio will use when requesting the above URL. Either GET or POST. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com. - -AvailablePhoneNumber -======================== - -.. php:class:: Services_Twilio_Rest_AvailablePhoneNumber - - For more information, see the `AvailablePhoneNumber Instance Resource `_ documentation. - - .. php:attr:: friendly_name - - A nicely-formatted version of the phone number. - - .. php:attr:: phone_number - - The phone number, in E.164 (i.e. "+1") format. - - .. php:attr:: lata - - The LATA of this phone number. - - .. php:attr:: rate_center - - The rate center of this phone number. - - .. php:attr:: latitude - - The latitude coordinate of this phone number. - - .. php:attr:: longitude - - The longitude coordinate of this phone number. - - .. php:attr:: region - - The two-letter state or province abbreviation of this phone number. - - .. php:attr:: postal_code - - The postal (zip) code of this phone number. - - .. php:attr:: iso_country - -Call -==== - -.. phpautoclass:: Services_Twilio_Rest_Call - :filename: ../Services/Twilio/Rest/Call.php - :members: - -CallerId -============ - -.. php:class:: Services_Twilio_Rest_OutgoingCallerId - - For more information, see the `OutgoingCallerId Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: friendly_name - - 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. - - .. php:attr:: account_sid - - The unique id of the Account responsible for this Caller Id. - - .. php:attr:: phone_number - - The incoming phone number. Formatted with a '+' and country code e.g., +16175551212 (E.164 format). - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com. - -Conference -============= - -.. php:class:: Services_Twilio_Rest_Conference - - For more information, see the `Conference Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this conference. - - .. php:attr:: friendly_name - - A user provided string that identifies this conference room. - - .. php:attr:: status - - A string representing the status of the conference. May be init, in-progress, or completed. - - .. php:attr:: date_created - - The date that this conference was created, given as GMT in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this conference was last updated, given as GMT in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account responsible for creating this conference. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com. - - .. php:attr:: participants - - The :php:class:`Services_Twilio_Rest_Participants` instance, listing people currently in this conference - -CredentialListMapping -========================= - -.. phpautoclass:: Services_Twilio_Rest_CredentialListMapping - :filename: ../Services/Twilio/Rest/CredentialListMapping.php - :members: - - -CredentialList -================= - -.. phpautoclass:: Services_Twilio_Rest_CredentialList - :filename: ../Services/Twilio/Rest/CredentialList.php - :members: - -Credential -============== - -.. phpautoclass:: Services_Twilio_Rest_Credential - :filename: ../Services/Twilio/Rest/Credential.php - :members: - -Domain -========== - -.. phpautoclass:: Services_Twilio_Rest_Domain - :filename: ../Services/Twilio/Rest/Domain.php - :members: - -IncomingPhoneNumber -=================== - -.. phpautoclass:: Services_Twilio_Rest_IncomingPhoneNumber - :filename: ../Services/Twilio/Rest/IncomingPhoneNumber.php - :members: - -IpAccessControlListMapping -============================== - -.. phpautoclass:: Services_Twilio_Rest_IpAccessControlListMapping - :filename: ../Services/Twilio/Rest/IpAccessControlListMapping.php - :members: - -IpAccessControlList -======================= - -.. phpautoclass:: Services_Twilio_Rest_IpAccessControlList - :filename: ../Services/Twilio/Rest/IpAccessControlList.php - :members: - -IpAddress -============== -.. phpautoclass:: Services_Twilio_Rest_IpAddress - :filename: ../Services/Twilio/Rest/IpAddress.php - :members: - - -Notification -============= - -.. php:class:: Services_Twilio_Rest_Notification - - For more information, see the `Notification Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account responsible for this notification. - - .. php:attr:: call_sid - - CallSid is the unique id of the call during which the notification was generated. Empty if the notification was generated by the REST API without regard to a specific phone call. - - .. php:attr:: api_version - - The version of the Twilio in use when this notification was generated. - - .. php:attr:: log - - An integer log level corresponding to the type of notification: 0 is ERROR, 1 is WARNING. - - .. php:attr:: error_code - - A unique error code for the error condition. You can lookup errors, with possible causes and solutions, in our `Error Dictionary `_. - - .. php:attr:: more_info - - A URL for more information about the error condition. The URL is a page in our `Error Dictionary `_. - - .. php:attr:: message_text - - The text of the notification. - - .. php:attr:: message_date - - The date the notification was actually generated, given in RFC 2822 - format. Due to buffering, this may be slightly different than the - DateCreated date. - - .. php:attr:: request_url - - The URL of the resource that generated the notification. If the - notification was generated during a phone call: This is the URL of the - resource on YOUR SERVER that caused the notification. If the notification - was generated by your use of the REST API: This is the URL of the REST - resource you were attempting to request on Twilio's servers. - - .. php:attr:: request_method - - The HTTP method in use for the request that generated the notification. If - the notification was generated during a phone call: The HTTP Method use to - request the resource on your server. If the notification was generated by - your use of the REST API: This is the HTTP method used in your request to - the REST resource on Twilio's servers. - - .. php:attr:: request_variables - - The Twilio-generated HTTP GET or POST variables sent to your server. Alternatively, if the notification was generated by the REST API, this field will include any HTTP POST or PUT variables you sent to the REST API. - - .. php:attr:: response_headers - - The HTTP headers returned by your server. - - .. php:attr:: response_body - - The HTTP body returned by your server. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com - -Media -======= - -.. phpautoclass:: Services_Twilio_Rest_MediaInstance - :filename: ../Services/Twilio/Rest/MediaInstance.php - :members: - -Member -======= - -.. php:class:: Services_Twilio_Rest_Member - - For more information about available properties, see the `Member Instance Resource `_ documentation. - - .. php:method:: dequeue($url, $method = 'POST') - - Dequeue this member and immediately play the Twiml at the given ``$url``. - - :param string $url: The Twiml URL to play for this member, after dequeuing them - :param string $method: The HTTP method to use when fetching the Twiml URL. Defaults to POST. - :return: The dequeued member - :rtype: :php:class:`Member ` - - -Participant -============= - -.. php:class:: Services_Twilio_Rest_Participant - - For more information, see the `Participant Instance Resource `_ documentation. - - .. php:attr:: call_sid - - A 34 character string that uniquely identifies the call that is connected to this conference - - .. php:attr:: conference_sid - - A 34 character string that identifies the conference this participant is in - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account that created this conference - - .. php:attr:: muted - - true if this participant is currently muted. false otherwise. - - .. php:attr:: start_conference_on_enter - - Was the startConferenceOnEnter attribute set on this participant (true or false)? - - .. php:attr:: end_conference_on_exit - - Was the endConferenceOnExit attribute set on this participant (true or false)? - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com. - -Queue -============ - -.. php:class:: Services_Twilio_Rest_Queue - - For more information about available properties of a queue, see the `Queue - Instance Resource `_ - documentation. A Queue has one subresource, a list of - :php:class:`Services_Twilio_Rest_Members`. - -Recording -============= - -.. php:class:: Services_Twilio_Rest_Recording - - For more information, see the `Recording Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account responsible for this recording. - - .. php:attr:: call_sid - - The call during which the recording was made. - - .. php:attr:: duration - - The length of the recording, in seconds. - - .. php:attr:: api_version - - The version of the API in use during the recording. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com - - .. php:attr:: subresource_uris - - The list of subresources under this account - - .. php:attr:: formats - - A dictionary of the audio formats available for this recording - - .. code-block:: php - - array( - 'wav' => 'https://api.twilio.com/path/to/recording.wav', - 'mp3' => 'https://api.twilio.com/path/to/recording.mp3', - ) - -Message -======= - -.. phpautoclass:: Services_Twilio_Rest_Message - :filename: ../Services/Twilio/Rest/Message.php - :members: - -SmsMessage -=========== - -.. php:class:: Services_Twilio_Rest_SmsMessage - - For more information, see the `SMS Message Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: date_sent - - The date that the SMS was sent, given in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account that sent this SMS message. - - .. php:attr:: from - - The phone number that initiated the message in E.164 format. For incoming messages, this will be the remote phone. For outgoing messages, this will be one of your Twilio phone numbers. - - .. php:attr:: to - - The phone number that received the message in E.164 format. For incoming messages, this will be one of your Twilio phone numbers. For outgoing messages, this will be the remote phone. - - .. php:attr:: body - - The text body of the SMS message. Up to 160 characters long. - - .. php:attr:: status - - The status of this SMS message. Either queued, sending, sent, or failed. - - .. php:attr:: direction - - The direction of this SMS message. ``incoming`` for incoming messages, - ``outbound-api`` for messages initiated via the REST API, ``outbound-call`` for - messages initiated during a call or ``outbound-reply`` for messages initiated in - response to an incoming SMS. - - .. php:attr:: price - - The amount billed for the message. - - .. php:attr:: api_version - - The version of the Twilio API used to process the SMS message. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com - - -Transcription -================== - -.. php:class:: Services_Twilio_Rest_Transcription - - For more information, see the `Transcription Instance Resource `_ documentation. - - .. php:attr:: sid - - A 34 character string that uniquely identifies this resource. - - .. php:attr:: date_created - - The date that this resource was created, given in RFC 2822 format. - - .. php:attr:: date_updated - - The date that this resource was last updated, given in RFC 2822 format. - - .. php:attr:: account_sid - - The unique id of the Account responsible for this transcription. - - .. php:attr:: status - - A string representing the status of the transcription: ``in-progress``, ``completed`` or ``failed``. - - .. php:attr:: recording_sid - - The unique id of the Recording this Transcription was made of. - - .. php:attr:: duration - - The duration of the transcribed audio, in seconds. - - .. php:attr:: transcription_text - - The text content of the transcription. - - .. php:attr:: price - - The charge for this transcript in USD. Populated after the transcript is completed. Note, this value may not be immediately available. - - .. php:attr:: uri - - The URI for this resource, relative to https://api.twilio.com - - diff --git a/vendor/twilio-php-master/docs/api/services.rst b/vendor/twilio-php-master/docs/api/services.rst deleted file mode 100644 index a69f212..0000000 --- a/vendor/twilio-php-master/docs/api/services.rst +++ /dev/null @@ -1,26 +0,0 @@ -############################### -HTTP Helper Classes -############################### - -********************** -The Twilio Rest Client -********************** - -.. phpautoclass:: Services_Twilio - :filename: ../Services/Twilio.php - :members: - -*************************** -Twilio's Custom HTTP Client -*************************** - -.. phpautoclass:: Services_Twilio_TinyHttp - :filename: ../Services/Twilio/TinyHttp.php - :members: - -*********************** -Twilio Rest Exceptions -*********************** -.. phpautoclass:: Services_Twilio_RestException - :filename: ../Services/Twilio/RestException.php - :members: diff --git a/vendor/twilio-php-master/docs/api/taskrouter.rst b/vendor/twilio-php-master/docs/api/taskrouter.rst deleted file mode 100644 index 45fda65..0000000 --- a/vendor/twilio-php-master/docs/api/taskrouter.rst +++ /dev/null @@ -1,762 +0,0 @@ -.. _api-taskrouter: - -###################### -Twilio TaskRouter API -###################### - -************** -List Resources -************** - -.. phpautoclass:: Services_Twilio_ListResource - :filename: ../Services/Twilio/ListResource.php - :members: - -All of the below classes inherit from the :php:class:`ListResource -`. - - -Workspaces -==================== -.. php:class:: Services_Twilio_Rest_TaskRouter_Workspaces - - For more information, see the Workspaces API Resource https://www.twilio.com/docs/taskrouter/workspaces - - .. php:method:: create($friendlyName, array $params = array()) - - Make a workspace - - :param string $friendlyName: String representing a user-friendly name for the Workspace - :param array $params: An array of optional parameters for this call - - The **$params** array can contain the following keys: - - *EventCallbackUrl* - If provided, the Workspace will publish events to this URL. You can use this to gather data for reporting. - - *Template* - One of the available template names. Will pre-configure this Workspace with the Workflow and Activities specified in the template. “NONE” will create a Workspace with a set of default activities and nothing else. "FIFO" will configure TaskRouter with a set of default activities and a single task queue for first-in, first-out distribution, useful if you want to see a simple TaskRouter configuration when getting started. - - -Workflows -==================== -.. php:class:: Services_Twilio_Rest_TaskRouter_Workflows - - For more information, see the Workflows API Resource https://www.twilio.com/docs/taskrouter/workflows - - .. php:method:: create($friendlyName, $configuration, $assignmentCallbackUrl, array $params = array()) - - Make a workflow - - :param string $friendlyName: String representing a user-friendly name for the Workflow - :param string $configuration: JSON document configuring the rules for this Workflow - :param string $assignmentCallbackUrl: A valid URL for the application that will process task assignment events - :param array $params: An array of optional parameters for this call - - The **$params** array **must** contain a TaskReservationTimeout, but FallbackAssignmentCallbackUrl is **optional**. - - *FallbackAssignmentCallbackUrl* - If the request to the AssignmentCallbackUrl fails, the assignment callback will be made to this URL - - *TaskReservationTimeout* - An integer value controlling how long in seconds TaskRouter will wait for a confirmation response from your application after assigning a Task to a worker - - -Workers -==================== -.. php:class:: Services_Twilio_Rest_TaskRouter_Workers - - For more information, see the Workers API Resource https://www.twilio.com/docs/taskrouter/workers - - .. php:method:: create($friendlyName, array $params = array()) - - Make a worker - - :param string $friendlyName: String representing a user-friendly name for the Worker - :param array $params: An array of optional parameters for this call - - The **$params** array can contain the following keys: - - *ActivitySid* - A valid Activity describing the worker's initial state - - *Attributes* - JSON object describing this worker - - -TaskQueues -==================== -.. php:class:: Services_Twilio_Rest_TaskRouter_TaskQueues - - For more information, see the TaskQueues API Resource https://www.twilio.com/docs/taskrouter/taskqueues - - .. php:method:: create($friendlyName, $assignmentActivitySid, $reservationActivitySid, array $params = array()) - - Make a task queue - - :param string $friendlyName: String representing a user-friendly name for the Task Queue - :param string $assignmentActivitySid: The activity to assign a worker when they accept a Task from this TaskQueue; defaults to 'Busy' - :param string $reservationActivitySid: The Activity to assign a Worker when they are reserved for a Task from this TaskQueue; defaults to 'Reserved' - :param array $params: An array of optional parameters for this call - - The **$params** array can contain the following keys: - - *TargetWorkers* - A string describing the Worker selection criteria for any Tasks that enter this TaskQueue - - *MaxReservedWorkers* - The maximum amount of workers to create reservations for the assignment of a task while in this queue; default = 1, max = 50 - - -Tasks -==================== -.. php:class:: Services_Twilio_Rest_TaskRouter_Tasks - - For more information, see the Tasks API Resource https://www.twilio.com/docs/taskrouter/tasks - - .. php:method:: create($attributes, $workflowSid, array $params = array()) - - Make a task - - :param string $attributes: The user-defined JSON string describing the custom attributes of this work - :param string $workflowSid: The ID of the Workflow responsible for routing this Task - :param array $params: An array of optional parameters for this call - - The **$params** array can contain the following keys: - - *Timeout* - The amount of time in seconds the task is allowed to live; default = 24 hours - - *Priority* - Override priority for the Task - - -Activities -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Activities - - For more information, see the Activities API Resource https://www.twilio.com/docs/taskrouter/activities documentation - - .. php:method:: create($friendlyName, $available) - - Make an activity - - :param string $friendlyName: String representing a user-friendly name for the Activity - :param string $available: Boolean value indicating whether the worker should be eligible to receive a Task when they occupy this Activity - - -Events -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Events - - For more information, see the Events API Resource https://www.twilio.com/docs/taskrouter/events documentation - - -Reservations -======================= - -.. php:class:: Services_Twilio_Rest_TaskRouter_Reservations - - For more information, see the Task Reservation Instance Subresource section on https://www.twilio.com/docs/taskrouter/tasks documentation - - -Workers Statistics -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_WorkersStatistics - - For more information, see the Worker Statistics API Resource https://www.twilio.com/docs/taskrouter/worker-statistics documentation - - -TaskQueue Statistics -====================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_TaskQueuesStatistics - - For more information, see the TaskQueue Statistics API Resource https://www.twilio.com/docs/taskrouter/taskqueue-statistics documentation - -******************** -Instance Resources -******************** - -.. phpautoclass:: Services_Twilio_InstanceResource - :filename: ../Services/Twilio/InstanceResource.php - :members: - -Below you will find a list of objects created by interacting with the Twilio -API, and the methods and properties that can be called on them. These are -derived from the :php:class:`ListResource ` and -:php:class:`InstanceResource ` above. - - -Workspace -==================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Workspace - - .. php:attr:: sid - - The unique ID of the Workspace - - .. php:attr:: account_sid - - The ID of the account that owns this Workflow - - .. php:attr:: friendly_name - - Human readable description of this workspace (for example “Sales Call Center” or “Customer Support Team”) - - .. php:attr:: default_activity_sid - - The ID of the Activity that will be used when new Workers are created in this Workspace. - - .. php:attr:: default_activity_name - - The human readable name of the default activity. Read only. - - .. php:attr:: timeout_activity_sid - - The ID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. - - .. php:attr:: timeout_activity_name - - The human readable name of the timeout activity. Read only. - - .. php:attr:: event_callback_url - - An optional URL where the Workspace will publish events. You can use this to gather data for reporting. See Workspace Events for more information. Optional. - - .. php:attr:: date_created - - The time the Workspace was created, given as GMT in ISO 8601 format. - - .. php:attr:: date_updated - - The time the Workspace was last updated, given as GMT in ISO 8601 format. - - -Workflow -================ - -.. php:class:: Services_Twilio_Rest_TaskRouter_Workflow - - .. php:attr:: sid - - The unique ID of the Workflow - - .. php:attr:: account_sid - - The ID of the account that owns this Workflow - - .. php:attr:: workspace_sid - - The ID of the Workspace that contains this Workflow - - .. php:attr:: friendly_name - - Human readable description of this Workflow (for example “Customer Support” or “2014 Election Campaign”) - - .. php:attr:: assignment_callback_url - - The URL that will be called whenever a task managed by this Workflow is assigned to a Worker. - - .. php:attr:: fallback_assignment_callback_url - - If the request to the AssignmentCallbackUrl fails, the assignment callback will be made to this URL. - - .. php:attr:: configuration - - JSON document configuring the rules for this Workflow. See Configuring Workflows for more information. - - .. php:attr:: task_reservation_timeout - - Determines how long TaskRouter will wait for a confirmation response from your application after assigning a Task to a worker. Defaults to 120 seconds. - - .. php:attr:: date_created - - The date this workflow was created. - - .. php:attr:: date_updated - - The date this workflow was updated. - -Worker -================ - -.. php:class:: Services_Twilio_Rest_TaskRouter_Worker - - .. php:attr:: friendly_name - - Filter by a worker’s friendly name - - .. php:attr:: task_queue_sid - - Filter by workers that are eligible for a TaskQueue by SID - - .. php:attr:: task_queue_name - - Filter by workers that are eligible for a TaskQueue by Friendly Name - - .. php:attr:: activity_sid - - Filter by workers that are in a particular Activity by SID - - .. php:attr:: activity_name - - Filter by workers that are in a particular Activity by Friendly Name - - .. php:attr:: available - - Filter by workers that are available or unavailable. (Note: This can be ‘true’, ‘1’’ or ‘yes’ to indicate a true value. All other values will represent false) - - .. php:attr:: target_workers_expression - - Filter by workers that would match an expression on a TaskQueue. This is helpful for debugging which workers would match a potential queue. - - -TaskQueue -================ - -.. php:class:: Services_Twilio_Rest_TaskRouter_TaskQueue - - .. php:attr:: sid - - The unique ID of the TaskQueue - - .. php:attr:: account_sid - - The ID of the Account that owns this TaskQueue - - .. php:attr:: workspace_sid - - The ID of the Workspace that owns this TaskQueue - - .. php:attr:: friendly_name - - Human readable description of the TaskQueue (for example “Customer Support” or “Sales”) - - .. php:attr:: target_workers - - The worker selection expressions associated with this TaskQueue. - - .. php:attr:: reservation_activity_sid - - The Activity to assign a Worker when they are reserved for a Task from this TaskQueue. Defaults to 'Reserved for Task' - - .. php:attr:: assignment_activity_sid - - The Activity to assign a Worker when they accept a Task from this TaskQueue. Defaults to 'Unavailable for Assignment'. - - .. php:attr:: max_reserved_workers - - The maximum amount of workers to create reservations for the assignment of a task while in this queue. - -Task -==================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Task - - .. php:attr:: sid - - The unique ID of the Task - - .. php:attr:: account_sid - - The ID of the account that owns this Task - - .. php:attr:: workspace_sid - - The ID of the Workspace that holds this Task - - .. php:attr:: workflow_sid - - The ID of the Workflow responsible for routing this Task - - .. php:attr:: attributes - - The user-defined JSON string describing the custom attributes of this work. - - .. php:attr:: age - - The number of seconds since this task was created. - - .. php:attr:: priority - - The current priority score of the task, as assigned by the workflow. Tasks with higher values will be assigned before tasks with lower values. - - .. php:attr:: task_queue_sid - - The current TaskQueue occupied, controlled by the Workflow's Workflow. - - .. php:attr:: assignment_status - - A string representing the Assignment State of the task. May be pending, reserved, assigned or canceled. See the table of Task Assignment Status values below for more information. - - .. php:attr:: reason - - The reason the task was canceled (if applicable) - - .. php:attr:: date_created - - Date this task was created, given as ISO 8601 format. - - .. php:attr:: date_updated - - Date this task was updated, given as ISO 8601 format. - - .. php:attr:: timeout - - The amount of time in seconds the task is allowed to live - -Activity -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Activity - - .. php:attr:: sid - - The unique ID for this Activity. - - .. php:attr:: account_sid - - The unique ID of the Account that owns this Activity. - - .. php:attr:: workspace_sid - - The unique ID of the Workspace that this Activity belongs to. - - .. php:attr:: friendly_name - - A human-readable name for the Activity, such as 'on-call', 'break', 'email', etc. These names will be used to calculate and expose statistics about workers, and give you visibility into the state of each of your workers. - - .. php:attr:: available - - Boolean value indicating whether the worker should be eligible to receive a Task when they occupy this Activity. For example, in an activity called 'On Call', the worker would be unavailable to receive additional Task assignments. - - .. php:attr:: date_created - - The date this Activity was created. - - .. php:attr:: date_updated - - The date this Activity was updated. - -Event -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Event - - .. php:attr:: event_type - - An identifier for this event - - .. php:attr:: account_sid - - The account owning this event - - .. php:attr:: description - - A description of the event - - .. php:attr:: resource_type - - The type of object this event is most relevant to (Task, Reservation, Worker) - - .. php:attr:: resource_sid - - The sid of the object this event is most relevant to (TaskSid, ReservationSid, WorkerSid) - - .. php:attr:: event_date - - The time this event was sent - - .. php:attr:: event_data - - Data about this specific event - - -Reservation -======================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_Reservation - - .. php:attr:: sid - - The unique ID of this Reservation - - .. php:attr:: account_sid - - The ID of the Account that owns this Task - - .. php:attr:: workspace_sid - - The ID of the Workspace that this task is contained within - - .. php:attr:: task_sid - - The ID of the reserved Task - - .. php::attr:: worker_sid - - The ID of the reserverd Worker - - .. php:attr:: worker_name - - Human readable description of the Worker that is reserved - - .. php:attr:: reservation_status - - The current status of the reservation - - -Workspace Statistics -=========================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_WorkspaceStatistics - - .. php:attr:: longest_task_waiting_sid - - The ID of the longest waiting Task - - .. php:attr:: longest_task_waiting_age - - The age of the longest waiting Task - - .. php:attr:: total_tasks - - The total number of Tasks - - .. php:attr:: total_workers - - The total number of Workers in the workspace - - .. php:attr:: tasks_by_status - - The Tasks broken down by status (for example: pending: 1, reserved = 3, assigned = 2) - - .. php:attr:: activity_statistics - - A breakdown of Workers by Activity (for example: Idle : 0, Busy: 5, Reserved = 0, Offline = 2) - - .. php:attr:: tasks_created - - The total number of Tasks created - - .. php:attr:: tasks_canceled - - The total number of Tasks that were canceled - - .. php:attr:: tasks_deleted - - The total number of Tasks that were deleted - - .. php:attr:: tasks_moved - - The total number of Tasks that were moved from one queue to another - - .. php:attr:: tasks_timed_out_in_workflow - - The total number of Tasks that were timed out of their Workflows (and deleted) - - .. php:attr:: avg_task_acceptance_time - - The average time (in seconds) from Task creation to acceptance - - .. php:attr:: reservations_created - - The total number of Reservations that were created for Workers - - .. php:attr:: reservations_accepted - - The total number of Reservations accepted by Workers - - .. php:attr:: reservations_rejected - - The total number of Reservations that were rejected - - .. php:attr:: reservations_timed_out - - The total number of Reservations that were timed out - - .. php:attr:: reservations_canceled - - The total number of Reservations that were canceled - - .. php:attr:: reservations_rescinded - - The total number of Reservations that were rescinded - - -Workflow Statistics -====================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_WorkflowStatistics - - .. php:attr:: longest_task_waiting_sid - - The ID of the longest waiting Task - - .. php:attr:: longest_task_waiting_age - - The age of the longest waiting Task - - .. php:attr:: total_tasks - - The total number of Tasks - - .. php:attr:: tasks_by_status - - The Tasks broken down by status (for example: pending: 1, reserved = 3, assigned = 2) - - .. php:attr:: tasks_entered - - The total number of Tasks that entered this Workflow - - .. php:attr:: tasks_canceled - - The total number of Tasks that were canceled - - .. php:attr:: tasks_deleted - - The total number of Tasks that were deleted - - .. php:attr:: tasks_moved - - The total number of Tasks that were moved from one queue to another - - .. php:attr:: tasks_timed_out_in_workflow - - The total number of Tasks that were timed out of their Workflows (and deleted) - - .. php:attr:: avg_task_acceptance_time - - The average time (in seconds) from Task creation to acceptance - - .. php:attr:: reservations_created - - The total number of Reservations that were created for Workers - - .. php:attr:: reservations_accepted - - The total number of Reservations accepted by Workers - - .. php:attr:: reservations_rejected - - The total number of Reservations that were rejected - - .. php:attr:: reservations_timed_out - - The total number of Reservations that were timed out - - .. php:attr:: reservations_canceled - - The total number of Reservations that were canceled - - .. php:attr:: reservations_rescinded - - The total number of Reservations that were rescinded - -Worker Statistics -====================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_WorkerStatistics - - .. php:attr:: reservations_created - - The total number of Reservations that were created - - .. php:attr:: reservations_accepted - - The total number of Reservations accepted - - .. php:attr:: reservations_rejected - - The total number of Reservations that were rejected - - .. php:attr:: reservations_timed_out - - The total number of Reservations that were timed out - - .. php:attr:: reservations_canceled - - The total number of Reservations that were canceled - - .. php:attr:: activity_duration - - The minimum, average, maximum and total time (in seconds) this Worker spent in each Activity - - -TaskQueue Statistics -====================== - -.. php:class:: Services_Twilio_Rest_TaskRouter_TaskQueueStatistics - - .. php:attr:: longest_task_waiting_sid - - The ID of the longest waiting Task - - .. php:attr:: longest_task_waiting_age - - The age of the longest waiting Task - - .. php:attr:: total_tasks - - The total number of Tasks - - .. php:attr:: tasks_by_status - - The Tasks broken down by status (for example: pending: 1, reserved = 3, assigned = 2) - - .. php:attr:: activity_statistics - - The current Worker status count breakdown by Activity - - .. php:attr:: total_eligible_workers - - The total number of Workers eligible for Tasks in this TaskQueue - - .. php:attr:: total_available_workers - - The total number of Workers available for Tasks in this TaskQueue - - .. php:attr:: tasks_entered - - The total number of Tasks entered into this TaskQueue - - .. php:attr:: tasks_canceled - - The total number of Tasks canceled while in this TaskQueue - - .. php:attr:: tasks_deleted - - The total number of Tasks that were deleted while in this TaskQueue - - .. php:attr:: tasks_moved - - The total number of Tasks moved to another TaskQueue from this TaskQueue - - .. php:attr:: avg_task_acceptance_time - - The average time (in seconds) from Task creation to acceptance while in this TaskQueue - - .. php:attr:: reservations_accepted - - The total number of Reservations that were accepted for Tasks while in this TaskQueue - - .. php:attr:: reservations_rejected - - The total number of Reservations that were rejected for Tasks while in this TaskQueue - - .. php:attr:: reservations_timed_out - - The total number of Reservations that were tiemd out for Tasks while in this TaskQueue - - .. php:attr:: reservations_canceled - - The total number of Reservations that were canceled for Tasks while in this TaskQueue - - .. php:attr:: reservations_rescinded - - The total number of Reservations that were rescinded diff --git a/vendor/twilio-php-master/docs/api/twiml.rst b/vendor/twilio-php-master/docs/api/twiml.rst deleted file mode 100644 index de9f4c4..0000000 --- a/vendor/twilio-php-master/docs/api/twiml.rst +++ /dev/null @@ -1,7 +0,0 @@ -########################################### -API for TwiML Generation -########################################### - -.. phpautoclass:: Services_Twilio_Twiml - :filename: ../Services/Twilio/Twiml.php - :members: diff --git a/vendor/twilio-php-master/docs/conf.py b/vendor/twilio-php-master/docs/conf.py deleted file mode 100644 index 02aad3c..0000000 --- a/vendor/twilio-php-master/docs/conf.py +++ /dev/null @@ -1,226 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Services_Twilio documentation build configuration file, created by -# sphinx-quickstart on Tue Mar 8 04:02:01 2011. -# -# 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. - -import sys, os -from datetime import datetime - -# 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. -#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 = ['sphinxcontrib.phpdomain', 'sphinxcontrib_phpautodoc'] - -primary_domain = 'php' - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -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'Services_Twilio' -copyright = unicode(datetime.utcnow().year) + u', Twilio Inc' - -# 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 = '4.6' -# The full version, including alpha/beta/rc tags. -release = '4.6.0' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#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. -exclude_patterns = ['_build'] - -# 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 = [] - - -# -- Options for HTML output --------------------------------------------------- -sys.path.append(os.path.abspath('_themes')) -html_theme_path = ['_themes'] -html_theme = 'kr' - -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer -lexers['php'] = PhpLexer(startinline=True) - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -#html_theme = 'default' - -# 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. If None, it defaults to -# " v documentation". -#html_title = None - -# 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 (within the static path) to use as 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'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# 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 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 - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Services_Twiliodoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'Services_Twilio.tex', u'Services\\_Twilio 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 - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# 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 = [ - ('index', 'services_twilio', u'Services_Twilio Documentation', - [u'Neuman Vong'], 1) -] diff --git a/vendor/twilio-php-master/docs/faq.rst b/vendor/twilio-php-master/docs/faq.rst deleted file mode 100644 index 015e631..0000000 --- a/vendor/twilio-php-master/docs/faq.rst +++ /dev/null @@ -1,130 +0,0 @@ -========================== -Frequently Asked Questions -========================== - -Hopefully you can find an answer here to one of your questions. If not, please -contact `help@twilio.com `_. - -Debugging Requests ------------------- - -Sometimes the library generates unexpected output. The simplest way to debug is -to examine the HTTP request that twilio-php actually sent over the wire. You -can turn on debugging with a simple flag: - -.. code-block:: php - - require('Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '456bef'); - $client->http->debug = true; - -Then make requests as you normally would. The URI, method, headers, and body -of HTTP requests will be logged via the ``error_log`` function. - - -require: Failed to open stream messages ------------------------------------------ - -If you are trying to use the helper library and you get an error message that -looks like this: - -.. code-block:: php - - PHP Warning: require(Services/Twilio.php): failed to open stream: No such - file or directory in /path/to/file - - Fatal error: require(): Failed opening required 'Services/Twilio.php' - (include_path='.:/usr/lib/php:/usr/local/php-5.3.8/lib/php') in - /Library/Python/2.6/site-packages/phpsh/phpsh.php(578): on line 1 - -Your PHP file can't find the Twilio library. The easiest way to do this is to -move the Services folder from the twilio-php library into the folder containing -your file. So if you have a file called ``send-sms.php``, your folder structure -should look like this: - -.. code-block:: bash - - . - ├── send-sms.php - ├── Services - │   ├── Twilio.php - │   ├── Twilio - │   │   ├── ArrayDataProxy.php - │   │   ├── (..about 50 other files...) - -If you need to copy all of these files to your web hosting server, the easiest -way is to compress them into a ZIP file, copy that to your server with FTP, and -then unzip it back into a folder in your CPanel or similar. - -You can also try changing the ``require`` line like this: - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - -SSL Validation Exceptions -------------------------- - -If you are using an outdated version of `libcurl`, you may encounter -SSL validation exceptions. If you see the following error message, you have -a SSL validation exception: :: - - Fatal error: Uncaught exception 'Services_Twilio_TinyHttpException' - with message 'SSL certificate problem, verify that the CA cert is OK. - - Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate - verify failed' in [MY PATH]\Services\Twilio\TinyHttp.php:89 - -This means that Twilio is trying to offer a certificate to verify that you are -actually connecting to `https://api.twilio.com `_, but -your curl client cannot verify our certificate. - -Upgrade your version of the twilio-php library -============================================== - -From November 2011 to November 2014, the SSL certificate was built into -the helper library, and it is used to sign requests made to our API. Older -releases of the helper library include expired certificates and will not -work against the current API certificates. If you are -still encountering this problem, you can upgrade your helper library to the -latest version, and you should not encounter this error anymore. - -If you are using an older version of the helper library and cannot upgrade, you -can try the the following: - -Disable the local copy of Twilio's certificate -============================================== - -Replace this line in your client code that uses the Twilio helper library: - -.. code-block:: php - - $client = new Services_Twilio($sid, $token); - -With this one: - -.. code-block:: php - - $http = new Services_Twilio_TinyHttp( - 'https://api.twilio.com', - array('curlopts' => array( - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => 2, - )) - ); - - $client = new Services_Twilio($sid, $token, "2010-04-01", $http); - - -Upgrade your version of libcurl -=============================== - -The certificate authority Twilio uses is included in the latest version of the -``libcurl`` library. Upgrading your system version of ``libcurl`` will -resolve the SSL error. `Click here to download the latest version of -libcurl `_. - -If this does not work, double check your Account SID, token, and that you do -not have errors anywhere else in your code. If you need further assistance, -please email our customer support at `help@twilio.com`_. diff --git a/vendor/twilio-php-master/docs/index.rst b/vendor/twilio-php-master/docs/index.rst deleted file mode 100644 index 38ac121..0000000 --- a/vendor/twilio-php-master/docs/index.rst +++ /dev/null @@ -1,232 +0,0 @@ -.. Services_Twilio documentation master file, created by - sphinx-quickstart on Tue Mar 8 04:02:01 2011. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -================= -**twilio-php** -================= - -Status -======= - -This documentation is for version 4.6.0 of `twilio-php -`_. - -Quickstart -============ - -Send an SMS ->>>>>>>>>>> - -.. code-block:: php - - // Download the library and copy into the folder containing this file. - require('/path/to/twilio-php/Services/Twilio.php'); - - $account_sid = "ACXXXXXX"; // Your Twilio account sid - $auth_token = "YYYYYY"; // Your Twilio auth token - - $client = new Services_Twilio($account_sid, $auth_token); - $message = $client->account->messages->sendMessage( - '+14085551234', // From a Twilio number in your account - '+12125551234', // Text any number - "Hello monkey!" - ); - - print $message->sid; - -Make a Call ->>>>>>>>>>>>>> - -.. code-block:: php - - // Download the library and copy into the folder containing this file. - require('/path/to/twilio-php/Services/Twilio.php'); - - $account_sid = "ACXXXXXX"; // Your Twilio account sid - $auth_token = "YYYYYY"; // Your Twilio auth token - - $client = new Services_Twilio($account_sid, $auth_token); - $call = $client->account->calls->create( - '+14085551234', // From a Twilio number in your account - '+12125551234', // Call any number - - // Read TwiML at this URL when a call connects (hold music) - 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient' - ); - -Generating TwiML ->>>>>>>>>>>>>>>> - -To control phone calls, your application needs to output `TwiML -`_. Use :class:`Services_Twilio_Twiml` -to easily create such responses. - -.. code-block:: php - - $response = new Services_Twilio_Twiml(); - $response->say('Hello'); - $response->play('https://api.twilio.com/cowbell.mp3', array("loop" => 5)); - print $response; - -.. code-block:: xml - - - - Hello - https://api.twilio.com/cowbell.mp3 - - -View more examples of TwiML generation here: :ref:`usage-twiml` - -Creating a Task -=================== - -You can easily create a task. Tasks can represent whatever type of work is important for your team. Twilio applications can create tasks from phone calls or SMS messages. - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set task parameters - $workflowSid = 'YOUR_WORKFLOW_SID'; - $taskAttributes = '{"selected_language": "fr"}'; - $priority = 10; - $timeout = 100; - - // create task - $task = $taskrouterClient->workspace->tasks->create( - $taskAttributes, - $workflowSid, - array( - 'Priority' => $priority, - 'Timeout' => $timeout - ) - ); - - // confirm task created - echo "Created Task: ".$task->sid; - -Find more examples and details of TaskRouter here: :ref:`usage-taskrouter` - -Installation -============ - -There are two ways to install **twilio-php**: via Composer, or by -downloading the source. - -Via Composer ->>>>>>>>>>>>> - -.. code-block:: bash - - composer require 'twilio/sdk' - -From Source ->>>>>>>>>>>>> - -If you aren't using Composer, download the `source (.zip) -`_, which includes all the -dependencies. - -User Guide -================== - -REST API ->>>>>>>>>> - -.. toctree:: - :maxdepth: 2 - :glob: - - usage/rest - usage/rest/* - -TwiML and other utilities ->>>>>>>>>>>>>>>>>>>>>>>>>> - -.. toctree:: - :maxdepth: 1 - - usage/twiml - usage/validation - usage/token-generation - faq/ - -TaskRouter Reference ->>>>>>>>>>>>>>>>>>>>> - -.. toctree:: - :maxdepth: 2 - :glob: - - usage/taskrouter - usage/taskrouter/* - -API Documentation -================== - -.. toctree:: - :maxdepth: 3 - :glob: - - api/* - - -Support and Development -=========================== - -All development occurs on `Github `_. To -check out the source, run - -.. code-block:: bash - - git clone git@github.com:twilio/twilio-php.git - -Report bugs using the Github `issue tracker `_. - -If you've got questions that aren't answered by this documentation, ask the -Twilio support team at help@twilio.com. - -Running the Tests ->>>>>>>>>>>>>>>>>>>>>>>>> - -The unit tests depend on `Mockery `_ and -`PHPUnit `_. First, 'discover' all -the necessary `PEAR` channels: - -.. code-block:: bash - - make test-install - -After installation, run the tests with :data:`make`. - -.. code-block:: bash - - make test - - -Making the Documentation ->>>>>>>>>>>>>>>>>>>>>>>>>> - -Our documentation is written using `Sphinx `_. You'll -need to install Sphinx and the Sphinx PHP domain before you can build the docs. - -.. code-block:: bash - - make docs-install - -Once you have those installed, making the docs is easy. - -.. code-block:: bash - - make docs - diff --git a/vendor/twilio-php-master/docs/quickstart.rst b/vendor/twilio-php-master/docs/quickstart.rst deleted file mode 100644 index f8441c3..0000000 --- a/vendor/twilio-php-master/docs/quickstart.rst +++ /dev/null @@ -1,34 +0,0 @@ -============= -Quickstart -============= - -Making a Call -============== - -.. code-block:: php - - $sid = "ACXXXXXX"; // Your Twilio account sid - $token = "YYYYYY"; // Your Twilio auth token - - $client = new Services_Twilio($sid, $token); - $call = $client->account->calls->create( - '9991231234', // From this number - '8881231234', // Call this number - 'http://foo.com/call.xml' - ); - -Generating TwiML -================== - -To control phone calls, your application need to output TwiML. Use :class:`Services_Twilio_Twiml` to easily create such responses. - -.. code-block:: php - - $response = new Services_Twilio_Twiml(); - $response->say('Hello'); - print $response; - -.. code-block:: xml - - - monkey.mp3 diff --git a/vendor/twilio-php-master/docs/requirements.txt b/vendor/twilio-php-master/docs/requirements.txt deleted file mode 100644 index 8c327a5..0000000 --- a/vendor/twilio-php-master/docs/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinxcontrib-phpdomain -hg+https://bitbucket.org/tk0miya/tk.phpautodoc - diff --git a/vendor/twilio-php-master/docs/usage/rest.rst b/vendor/twilio-php-master/docs/usage/rest.rst deleted file mode 100644 index e6edade..0000000 --- a/vendor/twilio-php-master/docs/usage/rest.rst +++ /dev/null @@ -1,98 +0,0 @@ -.. _ref-rest: - -========================== -Using the Twilio REST API -========================== - -Since version 3.0, we've introduced an updated API for interacting with the -Twilio REST API. Gone are the days of manual URL creation and XML parsing. - -Creating a REST Client -======================= - -Before querying the API, you'll need to create a :php:class:`Services_Twilio` -instance. The constructor takes your Twilio Account Sid and Auth -Token (both available through your `Twilio Account Dashboard -`_). - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - -The :attr:`account` attribute ------------------------------ - -You access the Twilio API resources through this :attr:`$client`, -specifically the :attr:`$account` attribute, which is an instance of -:php:class:`Services_Twilio_Rest_Account`. We'll use the `Calls resource -`_ as an example. - -Listing Resources -==================== - -Iterating over the :attr:`calls` attribute will iterate over all of your call -records, handling paging for you. Only use this when you need to get all your -records. - -The :attr:`$call` object is a :php:class:`Services_Twilio_Rest_Call`, which -means you can easily access fields through it's properties. The attribute names -are lowercase and use underscores for sepearators. All the available attributes -are documented in the :doc:`/api/rest` documentation. - -.. code-block:: php - - // If you have many calls, this could take a while - foreach($client->account->calls as $call) { - print $call->price . '\n'; - print $call->duration . '\n'; - } - -Filtering Resources -------------------- - -Many Twilio list resources allow for filtering via :php:meth:`getIterator` -which takes an optional array of filter parameters. These parameters correspond -directlty to the listed query string parameters in the REST API documentation. - -You can create a filtered iterator like this: - -.. code-block:: php - - $filteredCalls = $client->account->calls->getIterator( - 0, 50, array("Status" => "in-progress")); - foreach($filteredCalls as $call) { - print $call->price . '\n'; - print $call->duration . '\n'; - } - -Retrieving the Total Number of Resources ----------------------------------------- - -Each of the list resources supports the `Countable` interface, which means you -can retrieve the total number of list items like so: - -.. code-block:: php - - echo count($client->account->calls); - -Getting a Specific Resource -============================= - -If you know the unique identifier for a resource, you can get that resource -using the :php:meth:`get` method on the list resource. - -.. code-block:: php - - $call = $client->account->calls->get("CA123"); - -:php:meth:`get` fetches objects lazily, so it will only load a resource when it -is needed. This allows you to get nested objects without making multiple HTTP -requests. - -.. code-block:: php - - $participant = $client->account->conferences - ->get("CO123")->participants->get("PF123"); - diff --git a/vendor/twilio-php-master/docs/usage/rest/accounts.rst b/vendor/twilio-php-master/docs/usage/rest/accounts.rst deleted file mode 100644 index de9bbe7..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/accounts.rst +++ /dev/null @@ -1,24 +0,0 @@ -================== -Accounts -================== - -Updating Account Information -============================== - -Updating :class:`Account ` information is really easy: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $account = $client->account; - $account->update(array('FriendlyName' => 'My Awesome Account')); - -Creating a Subaccount -============================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $subaccount = $client->accounts->create(array( - 'FriendlyName' => 'My Awesome SubAccount' - )); diff --git a/vendor/twilio-php-master/docs/usage/rest/applications.rst b/vendor/twilio-php-master/docs/usage/rest/applications.rst deleted file mode 100644 index 337cbba..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/applications.rst +++ /dev/null @@ -1,50 +0,0 @@ -================== -Applications -================== - -Creating Applications -============================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $application = $client->account->applications->create('Application Friendly Name', - array( - 'FriendlyName' => 'My Application Name', - 'VoiceUrl' => 'http://foo.com/voice/url', - 'VoiceFallbackUrl' => 'http://foo.com/voice/fallback/url', - 'VoiceMethod' => 'POST', - 'SmsUrl' => 'http://foo.com/sms/url', - 'SmsFallbackUrl' => 'http://foo.com/sms/fallback/url', - 'SmsMethod' => 'POST' - ) - ); - - -Updating An Application -============================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $application = $client->account->applications->get('AP123'); - $application->update(array( - 'VoiceUrl' => 'http://foo.com/new/voice/url' - )); - - -Finding an Application by Name -============================== - -Find an :class:`Application` by its name (full name match). - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $application = false; - $params = array( - 'FriendlyName' => 'My Application Name' - ); - foreach($client->account->applications->getIterator(0, 1, $params) as $_application) { - $application = $_application; - } \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/rest/callerids.rst b/vendor/twilio-php-master/docs/usage/rest/callerids.rst deleted file mode 100644 index 40841be..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/callerids.rst +++ /dev/null @@ -1,27 +0,0 @@ -============ - Caller Ids -============ - -Validate a Phone Number -======================= -Adding a new phone number to your validated numbers is quick and easy: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $response = $client->account->outgoing_caller_ids->create('+15554441234'); - print $response->validation_code; - -Twilio will call the provided number and for the validation code to be entered. - -Listing all Validated Phone Numbers -=================================== - -Show all the current caller_ids: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->outgoing_caller_ids as $caller_id) { - print $caller_id->friendly_name; - } diff --git a/vendor/twilio-php-master/docs/usage/rest/calls.rst b/vendor/twilio-php-master/docs/usage/rest/calls.rst deleted file mode 100644 index 5723f5e..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/calls.rst +++ /dev/null @@ -1,159 +0,0 @@ -============ - Phone Calls -============ - -Making a Phone Call -=================== - -The :class:`Calls` resource allows you to make outgoing calls: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $call = $client->account->calls->create( - '9991231234', // From this number - '8881231234', // Call this number - 'http://foo.com/call.xml' - ); - print $call->length; - print $call->sid; - -Adding Extra Call Parameters -============================ - -Add extra parameters, like a `StatusCallback` when the call ends, like this: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $call = $client->account->calls->create( - '9991231234', // From this number - '8881231234', // Call this number - 'http://foo.com/call.xml', - array( - 'StatusCallback' => 'http://foo.com/callback', - 'StatusCallbackMethod' => 'GET' - ) - ); - -A full list of extra parameters can be found `here -`_. - -Listing Calls -============= - -It's easy to iterate over your list of calls. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->calls as $call) { - echo "From: {$call->from}\nTo: {$call->to}\nSid: {$call->sid}\n\n"; - } - -Filtering Calls -=============== - -Let's say you want to find all of the calls that have been sent from -a particular number. You can do so by constructing an iterator explicitly: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->calls->getIterator(0, 50, array( - 'From' => '+14105551234' - )) as $call) { - echo "From: {$call->from}\nTo: {$call->to}\nSid: {$call->sid}\n\n"; - } - -Accessing Resources from a Specific Call -======================================== - -The :class:`Call` resource has some subresources you can access, such as -notifications, recordings and feedback. If you have already have a :class:`Call` -resource, they are easy to get: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->calls as $call) { - $notifications = $call->notifications; - if (is_array($notifications)) { - foreach ($notifications as $notification) { - print $notification->sid; - } - } - - $transcriptions = $call->transcriptions; - if (is_array($transcriptions)) { - foreach ($transcriptions as $transcription) { - print $transcription->sid; - } - } - - $recordings = $call->recordings; - if (is_array($recordings)) { - foreach ($recordings as $recording) { - print $recording->sid; - } - } - - $feedback = $call->feedback; - if ($feedback !== null) { - print $feedback->quality_score - } - } - -Be careful, as the above code makes quite a few HTTP requests and may display -PHP warnings for uninitialized variables. - -Retrieve a Call Record -====================== - -If you already have a :class:`Call` sid, you can use the client to retrieve -that record.: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $sid = "CA12341234"; - $call = $client->account->calls->get($sid) - -Delete a Call Record -==================== - -To protect your users' privacy and/or comply with legal requirements, Twilio allows you -to delete call records: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $sid = "CA12341234"; - $call = $client->account->calls->get($sid); - $call->delete(); - -Modifying live calls -==================== - -The :class:`Call` resource makes it easy to find current live calls and -redirect them as necessary: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $calls = $client->account->calls->getIterator(0, 50, array('Status' => 'in-progress')); - foreach ($calls as $call) { - $call->update(array('Url' => 'http://foo.com/new.xml', 'Method' => 'POST')); - } - -Ending all live calls is also possible: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $calls = $client->account->calls->getIterator(0, 50, array('Status' => 'in-progress')); - foreach ($calls as $call) { - $call->hangup(); - } - -Note that :meth:`hangup` will also cancel calls currently queued. diff --git a/vendor/twilio-php-master/docs/usage/rest/conferences.rst b/vendor/twilio-php-master/docs/usage/rest/conferences.rst deleted file mode 100644 index a47d7dd..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/conferences.rst +++ /dev/null @@ -1,48 +0,0 @@ -============= - Conferences -============= - -List All Conferences -==================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->conferences as $conference) { - print $conference->friendly_name; - } - -For a full list of properties available on a conference, as well as a full list -of ways to filter a conference, please see the `Conference API Documentation -`_ on our website. - -Filter Conferences by Status -============================ - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->conferences->getIterator(0, 50, array( - 'Status' => 'in-progress' - )) as $conf) { - print $conf->sid; - } - -Mute all participants -===================== - -At the moment, using an iterator directly will cause this method to infinitely -loop. Instead, use the getPage function. As conferences are limited to 40 -participants, getPage(0, 50) should return a list of every participant in -a conference. - -.. code-block:: php - - $sid = "CO119231312"; - $client = new Services_Twilio('AC123', '123'); - $conference = $client->account->conferences->get($sid); - $page = $conference->participants->getPage(0, 50); - $participants = $page->participants; - foreach ($participants as $p) { - $p->mute(); - } diff --git a/vendor/twilio-php-master/docs/usage/rest/members.rst b/vendor/twilio-php-master/docs/usage/rest/members.rst deleted file mode 100644 index 464fda1..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/members.rst +++ /dev/null @@ -1,46 +0,0 @@ -============= -Members -============= - -List All Members in a Queue -============================ - -Each queue instance resource has a list of members. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $queue_sid = 'QQ123'; - $queue = $client->account->queues->get('QQ123'); - foreach ($queue->members as $member) { - echo "Call Sid: {$member->call_sid}\nWait Time: {$member->wait_time}\n"; - } - -Dequeue a Member -================= - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $queue = $client->account->queues->get('QQ123'); - foreach ($queue->members as $member) { - // Dequeue the first member and fetch the Forward twimlet for that - // member. - $member->dequeue('http://twimlets.com/forward', 'GET'); - break; - } - -Retrieve the Member at the Front of a Queue -=========================================== - -The Members class has a method called ``front`` which can be used to retrieve -the member at the front of the queue. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $queue = $client->account->queues->get('QQ123'); - $firstMember = $queue->members->front(); - echo $firstMember->position; - echo $firstMember->call_sid; - diff --git a/vendor/twilio-php-master/docs/usage/rest/messages.rst b/vendor/twilio-php-master/docs/usage/rest/messages.rst deleted file mode 100644 index 76de032..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/messages.rst +++ /dev/null @@ -1,63 +0,0 @@ -============= -Messages -============= - -Sending a Message -===================== - -The :class:`Messages ` resource allows you to -send outgoing SMS or MMS messages. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $message = $client->account->messages->sendMessage( - '+14085551234', // From a Twilio number in your account - '+12125551234', // Text any number - 'Hello monkey!', // Message body (if any) - array('http://example.com/image.jpg'), // An array of MediaUrls - ); - - echo $message->sid; - -Listing Messages -==================== - -It's easy to iterate over your messages. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->messages as $message) { - echo "From: {$message->from}\nTo: {$message->to}\nBody: " . $message->body; - } - -Filtering Messages -====================== - -Let's say you want to find all of the messages that have been sent from -a particular number. You can do so by constructing an iterator explicitly: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->messages->getIterator(0, 50, array( - 'From' => '+14105551234', - )) as $message) { - echo "From: {$message->from}\nTo: {$message->to}\nBody: " . $message->body; - } - -Redacting or Deleting Messages -============================== - -To protect your users' privacy, you can delete your Message records or redact -their contents. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $message = $client->account->messages->get("MM123"); - $message->redact(); // Erases 'Body' field contents - $message->delete(); // Deletes entire message record \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/rest/notifications.rst b/vendor/twilio-php-master/docs/usage/rest/notifications.rst deleted file mode 100644 index 0df0c43..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/notifications.rst +++ /dev/null @@ -1,13 +0,0 @@ -=============== - Notifications -=============== - -Filter Notifications by Log Level -================================= - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->notifications->getIterator(0, 50, array("LogLevel" => 0)) as $n) { - print $n->error_code; - } diff --git a/vendor/twilio-php-master/docs/usage/rest/phonenumbers.rst b/vendor/twilio-php-master/docs/usage/rest/phonenumbers.rst deleted file mode 100644 index e929882..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/phonenumbers.rst +++ /dev/null @@ -1,187 +0,0 @@ -================= - Phone Numbers -================= - -Purchasing phone numbers is a two step process. - -Searching For a Number ----------------------- - -First, we need to search for an available phone number. Use the -:php:meth:`Services_Twilio_Rest_AvailablePhoneNumbers::getList` method of the -:php:class:`Services_Twilio_Rest_AvailablePhoneNumbers` list resource. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - $numbers = $client->account->available_phone_numbers->getList('US', 'TollFree'); - foreach($numbers->available_phone_numbers as $number) { - echo 'Number: ' + $number->phone_number + "\n"; - } - -You can also pass in parameters to search for phone numbers in a certain area -code, or which contain a certain pattern. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - - // Full parameter documentation at http://www.twilio.com/docs/api/rest/available-phone-numbers#local - $params = array('AreaCode' => '925', 'Contains' => 'hi'); - $numbers = $client->account->available_phone_numbers->getList('US', 'Local', $params); - foreach($numbers->available_phone_numbers as $number) { - echo 'Number: ' + $number->phone_number + "\n"; - } - -You can also use the type subresources to search for a given type. - -Available types include: -- `local` -- `toll_free` -- `mobile` - -.. code-block:: php - - // Local - $numbers = $client->account->available_phone_numbers->local; - foreach($numbers as $number) { - echo 'Number: ' + $number->phone_number + "\n"; - } - - // TollFree - $numbers = $client->account->available_phone_numbers->toll_free; - foreach($numbers as $number) { - echo 'Number: ' + $number->phone_number + "\n"; - } - - // Mobile - $numbers = $client->account->available_phone_numbers->mobile; - foreach($numbers as $number) { - echo 'Number: ' + $number->phone_number + "\n"; - } - - -Buying a Number ---------------- - -Once you have a phone number, purchase it by creating a new -:php:class:`Services_Twilio_Rest_IncomingPhoneNumber` instance. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - - $phoneNumber = '+44XXXYYYZZZZ'; - $purchasedNumber = $client->account->incoming_phone_numbers->create(array('PhoneNumber' => $phoneNumber)); - - echo $purchasedNumber->sid; - -Tying the two together, you can search for a number, and then purchase it. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - - // Full parameter documentation at http://www.twilio.com/docs/api/rest/available-phone-numbers#local - $params = array('AreaCode' => '800', 'Contains' => 'hi'); - - $numbers = $client->account->available_phone_numbers->getList('CA', 'TollFree', $params); - $firstNumber = $numbers->available_phone_numbers[0]->phone_number; - $purchasedNumber = $client->account->incoming_phone_numbers->create(array('PhoneNumber' => $firstNumber)); - - echo $purchasedNumber->sid; - -You can also purchase a random number with a given area code (US/Canada only): - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - $purchasedNumber = $client->account->incoming_phone_numbers->create(array('AreaCode' => '925')); - - echo $purchasedNumber->sid; - -Retrieving All of a Number's Properties ---------------------------------------- - -If you know the number and you want to retrieve all of the properties of that -number, such as the ``voice_url`` or the ``sms_method``, you can use the -:php:meth:`Services_Twilio_Rest_IncomingPhoneNumbers::getNumber` convenience -function. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - - // Number must be in e.164 format. - $number = $client->account->incoming_phone_numbers->getNumber('+14105551234'); - echo $number->voice_url; - -If you know the ``sid`` of a phone number, you can retrieve it using the -``get()`` function. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - - $number = $client->account->incoming_phone_numbers->get('PN123456'); - echo $number->voice_url; - -Updating a Number ------------------ - -You can easily update any of the properties of your -phone number. A full list of parameters is available -in the `Incoming Phone Number REST API Documentation. -`_ - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - $numbers = $client->account->incoming_phone_numbers; - foreach ($numbers as $number) { - $number->update(array('VoiceMethod' => 'POST')); - } - -Deleting a Number ------------------ - -You can delete numbers by specifying the Sid of the phone number you'd like to -delete, from the incoming phone numbers object. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - - $client = new Services_Twilio($accountSid, $authToken); - $numbers = $client->account->incoming_phone_numbers; - foreach($numbers as $number) { - // Delete just the first number, then quit. - $client->account->incoming_phone_numbers->delete($number->sid); - break; - } - diff --git a/vendor/twilio-php-master/docs/usage/rest/pricing.rst b/vendor/twilio-php-master/docs/usage/rest/pricing.rst deleted file mode 100644 index 2263282..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/pricing.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. _ref-rest: - -============================ -Using the Twilio Pricing API -============================ - -The Twilio Pricing API works similarly to the main Twilio REST API, -but is located on a new domain: `pricing.twilio.com`. - -The Pricing API is accessible through a new :php:class:`Pricing_Services_Twilio` -class that works much like the :php:class:`Services_Twilio` object you already -use for the main Twilio REST API. - -Creating a Pricing Client -========================= - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - -Accessing Resources -=================== - -The Pricing API resources function similarly to those available in the main -Twilio API. For basic examples, see :doc:`/usage/rest`. - -Voice Pricing -============= - -Twilio Voice pricing is available by country and by phone number. - -Voice calls are priced per minute and reflect the current Twilio list -price as well as any discounts available for your account at the time -you request pricing information. - -Voice Countries ---------------- - -To retrieve a list of countries where Twilio voice services are available: - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - - $countryList = $client->voiceCountries->getPage(); - foreach ($countryList->countries as $c) { - echo $c->isoCountry . "\n"; - } - -Note that the country objects in the returned list will not have pricing -information populated; you will need to retrieve the specific information -for each country you are interested in individually: - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - - $country = $client->voiceCountries->get("GB"); - echo $country->iso_country . "\n"; - echo $country->price_unit . "\n"; - - foreach ($country->outbound_prefix_prices as $price) { - // Price per minute before discounts - echo $price->base_price . "\n"; - // Price per minute after applying any discounts available - // to your account - echo $price->current_price . "\n"; - // Prefixes of phone numbers to which these rates apply - foreach ($price->prefixes as $prefix) { - echo $prefix . "\n"; - } - } - -Voice Numbers -------------- - -To retrieve pricing information for calls to and from a specific phone number: - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - - $number = $client->voiceNumbers->get("+15105551234"); - echo $number->price_unit . "\n"; - echo $number->outbound_call_price->call_base_price . "\n"; - // $number->inbound_call_price is only set for Twilio-hosted numbers - echo $number->inbound_call_price->call_base_price . "\n"; - -Phone Number Pricing -==================== - -Twilio Phone Numbers are priced per month. - -To retrieve a list of countries where Twilio Numbers are available: - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - - $countryList = $client->phoneNumberCountries->getPage(); - foreach ($countryList->countries as $c) { - echo $c->iso_country . "\n"; - } - -Note that the country objects in the returned list will not have pricing -information populated; you will need to retrieve the specific information -for each country you are interested in individually: - -.. code-block:: php - - $ACCOUNT_SID = "AC123"; - $AUTH_TOKEN = "secret"; - $client = new Pricing_Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); - - $country = $client->phoneNumberCountries->get("GB"); - echo $country->price_unit . "\n"; - - foreach ($country->phone_number_prices as $p) { - // "mobile", "toll_free", "local", or "national" - echo $p->number_type . "\n"; - // Number price per month before discounts - echo $p->base_price . "\n"; - // Number price per month after available discounts for your - // account have been applied - echo $p->current_price . "\n"; - } - diff --git a/vendor/twilio-php-master/docs/usage/rest/queues.rst b/vendor/twilio-php-master/docs/usage/rest/queues.rst deleted file mode 100644 index f75f333..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/queues.rst +++ /dev/null @@ -1,56 +0,0 @@ -============= -Queues -============= - -Create a New Queue -===================== - -To create a new queue, make an HTTP POST request to the Queues resource. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - // Default MaxSize is 100. Or change it by adding a parameter, like so - $queue = $client->account->queues->create('First Queue', - array('MaxSize' => 10)); - - print $queue->sid; - print $queue->friendly_name; - -Listing Queues -==================== - -It's easy to iterate over your list of queues. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->queues as $queue) { - echo $queue->sid; - } - -Deleting Queues -==================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $queue_sid = 'QQ123'; - $client->account->queues->delete('QQ123'); - -Retrieve the Member at the Front of a Queue -=========================================== - -The Members class has a method called ``front`` which can be used to retrieve -the member at the front of the queue. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - $queue = $client->account->queues->get('QQ123'); - $firstMember = $queue->members->front(); - echo $firstMember->position; - echo $firstMember->call_sid; - diff --git a/vendor/twilio-php-master/docs/usage/rest/recordings.rst b/vendor/twilio-php-master/docs/usage/rest/recordings.rst deleted file mode 100644 index 69cce54..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/recordings.rst +++ /dev/null @@ -1,61 +0,0 @@ -========== -Recordings -========== - -Listing Recordings ------------------- - -Run the following to get a list of all of your recordings: - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - $client = new Services_Twilio($accountSid, $authToken); - - foreach($client->account->recordings as $recording) { - echo "Access recording {$recording->sid} at:" . "\n"; - echo $recording->uri; - } - -For more information about which properties are available for a recording -object, please see the `Twilio Recordings API Documentation `_. - -Please note that the ``uri`` returned by default is a JSON dictionary -containing metadata about the recording; you can access the .wav version by -stripping the ``.json`` extension from the ``uri`` returned by the library. - -Filtering Recordings By Call Sid --------------------------------- - -Pass filters as an array to filter your list of recordings, with any of the -filters listed in the `recording list documentation `_. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - $client = new Services_Twilio($accountSid, $authToken); - - foreach($client->account->recordings->getIterator(0, 50, array('DateCreated>' => '2011-01-01')) as $recording) { - echo $recording->uri . "\n"; - } - -Deleting a Recording --------------------- - -To delete a recording, get the sid of the recording, and then pass it to the -client. - -.. code-block:: php - - $accountSid = 'AC1234567890abcdef1234567890a'; - $authToken = 'abcdef1234567890abcdefabcde9'; - $client = new Services_Twilio($accountSid, $authToken); - - foreach($client->account->recordings as $recording) { - $client->account->recordings->delete($recording->sid); - echo "Deleted recording {$recording->sid}, the first one in the list."; - break; - } - diff --git a/vendor/twilio-php-master/docs/usage/rest/sip.rst b/vendor/twilio-php-master/docs/usage/rest/sip.rst deleted file mode 100644 index 5a9cfee..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/sip.rst +++ /dev/null @@ -1,88 +0,0 @@ -============= -Sip In -============= - -Getting started with Sip -========================== - -If you're unfamiliar with SIP, please see the `SIP API Documentation -`_ on our website. - -Creating a Sip Domain -========================= - -The :class:`Domains ` resource allows you to -create a new domain. To create a new domain, you'll need to choose a unique -domain that lives under sip.twilio.com. For example, doug.sip.twilio.com. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $domain = $client->account->sip->domains->create( - "Doug's Domain", // The FriendlyName for your new domain - "doug.sip.twilio.com", // The sip domain for your new domain - array( - 'VoiceUrl' => 'http://example.com/voice', - )); - - echo $domain->sid; - -Creating a new IpAccessControlList -==================================== - -To control access to your new domain, you'll need to explicitly grant access -to individual ip addresses. To do this, you'll first need to create an -:class:`IpAccessControlList ` to hold -the ip addresses you wish to allow. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $ip_access_control_list = $client->account->sip->ip_access_control_lists->create( - "Doug's IpAccessControlList", // The FriendlyName for your new ip access control list - ); - - echo $ip_access_control_list->sid; - -Adding an IpAddress to an IpAccessControlList -============================================== - -Now it's time to add an :class:`IpAddress -` to your new :class:`IpAccessControlList -`. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $ip_address = $client->account->sip->ip_access_control_lists->get('AC123')->ip_addresses->create( - "Doug's IpAddress", // The FriendlyName for this IpAddress - '127.0.0.1', // The ip address for this IpAddress - ); - - echo $ip_address->sid; - -Adding an IpAccessControlList to a Domain -=========================================== - -Once you've created a :class:`Domain ` and an -:class:`IpAccessControlList ` -you need to associate them. To do this, -create an :class:`IpAccessControlListMapping -`. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $ip_access_control_list_mapping = $client->account->sip->domains->get('SD123')->ip_access_control_list_mappings->create( - 'AL123', // The sid of your IpAccessControlList - ); - - echo $ip_access_control_list_mapping->sid; diff --git a/vendor/twilio-php-master/docs/usage/rest/sms-messages.rst b/vendor/twilio-php-master/docs/usage/rest/sms-messages.rst deleted file mode 100644 index c1ccffe..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/sms-messages.rst +++ /dev/null @@ -1,50 +0,0 @@ -============= -SMS Messages -============= - -Sending a SMS Message -===================== - - -The :php:class:`Services_Twilio_Rest_SmsMessages` resource allows you to send -outgoing text messages. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio.php'); - - $client = new Services_Twilio('AC123', '123'); - $message = $client->account->sms_messages->create( - '+14085551234', // From a Twilio number in your account - '+12125551234', // Text any number - "Hello monkey!" - ); - - print $message->sid; - -Listing SMS Messages -==================== - -It's easy to iterate over your SMS messages. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->sms_messages as $message) { - echo "From: {$message->from}\nTo: {$message->to}\nBody: " . $message->body; - } - -Filtering SMS Messages -====================== - -Let's say you want to find all of the SMS messages that have been sent from -a particular number. You can do so by constructing an iterator explicitly: - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->sms_messages->getIterator(0, 50, array( - 'From' => '+14105551234', - )) as $message) { - echo "From: {$message->from}\nTo: {$message->to}\nBody: " . $message->body; - } diff --git a/vendor/twilio-php-master/docs/usage/rest/transcriptions.rst b/vendor/twilio-php-master/docs/usage/rest/transcriptions.rst deleted file mode 100644 index dfe38d6..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/transcriptions.rst +++ /dev/null @@ -1,13 +0,0 @@ -================ -Transcriptions -================ - -Show all Transcribed Messages -============================= - -.. code-block:: php - - $client = new Services_Twilio('AC123', '123'); - foreach ($client->account->transcriptions as $t) { - print $t->transcription_text; - } diff --git a/vendor/twilio-php-master/docs/usage/rest/usage-records.rst b/vendor/twilio-php-master/docs/usage/rest/usage-records.rst deleted file mode 100644 index bf33836..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/usage-records.rst +++ /dev/null @@ -1,91 +0,0 @@ -============= -Usage Records -============= - -Twilio offers a Usage Record API so you can better measure how much you've been -using Twilio. Here are some examples of how you can use PHP to access the usage -API. - -Retrieve All Usage Records -========================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_records as $record) { - echo "Record: $record"; - } - -Retrieve Usage Records For A Time Interval -========================================== - -UsageRecords support `several convenience subresources -`_ that -can be accessed as properties on the `record` object. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_records->last_month as $record) { - echo "Record: $record"; - } - -Retrieve All Time Usage for A Usage Category -============================================ - -By default, Twilio will return your all-time usage for a given usage category. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - $callRecord = $client->account->usage_records->getCategory('calls'); - echo $callRecord->usage; - -Retrieve All Usage for a Given Time Period -========================================== - -You can filter your UsageRecord list by providing `StartDate` and `EndDate` -parameters. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_records->getIterator(0, 50, array( - 'StartDate' => '2012-08-01', - 'EndDate' => '2012-08-31', - )) as $record) { - echo $record->description . "\n"; - echo $record->usage . "\n"; - } - -Retrieve Today's SMS Usage -========================== - -You can use the `today` record subresource, and then retrieve the record -directly with the `getCategory` function. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - // You can substitute 'yesterday', 'all_time' for 'today' below - $smsRecord = $client->account->usage_records->today->getCategory('sms'); - echo $smsRecord->usage; - -Retrieve Daily Usage Over a One-Month Period -============================================= - -The code below will retrieve daily summaries of recordings usage for August -2012. To retrieve all categories of usage, remove the 'Category' filter from -the `getIterator` array. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_records->daily->getIterator(0, 50, array( - 'StartDate' => '2012-08-01', - 'EndDate' => '2012-08-31', - 'Category' => 'recordings', - )) as $record) { - echo $record->usage; - } - diff --git a/vendor/twilio-php-master/docs/usage/rest/usage-triggers.rst b/vendor/twilio-php-master/docs/usage/rest/usage-triggers.rst deleted file mode 100644 index 18cce82..0000000 --- a/vendor/twilio-php-master/docs/usage/rest/usage-triggers.rst +++ /dev/null @@ -1,92 +0,0 @@ -============== -Usage Triggers -============== - -Twilio offers a Usage Trigger API so you can get notifications when your Twilio -usage exceeds a given level. Here are some examples of how you can -use PHP to create new usage triggers or modify existing triggers. - -Retrieve A Usage Trigger's Properties -===================================== - -If you know the Sid of your usage trigger, retrieving it is easy. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - $usageSid = 'UT123'; - $usageTrigger = $client->account->usage_triggers->get($usageSid); - echo $usageTrigger->usage_category; - -Update Properties on a UsageTrigger -=================================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - $usageSid = 'UT123'; - $usageTrigger = $client->account->usage_triggers->get($usageSid); - $usageTrigger->update(array( - 'FriendlyName' => 'New usage trigger friendly name', - 'CallbackUrl' => 'http://example.com/new-trigger-url', - )); - -Retrieve All Triggers -===================== - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_triggers as $trigger) { - echo "Category: {$trigger->usage_category}\nTriggerValue: {$trigger->trigger_value}\n"; - } - -Filter Trigger List By Category -=============================== - -Pass filters to the `getIterator` function to create a filtered list. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - foreach ($client->account->usage_triggers->getIterator( - 0, 50, array( - 'UsageCategory' => 'sms', - )) as $trigger - ) { - echo "Value: " . $trigger->trigger_value . "\n"; - } - -Create a New Trigger -==================== - -Pass a usage category, a value and a callback URL to the `create` method. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - $trigger = $client->account->usage_triggers->create( - 'totalprice', - '250.75', - 'http://example.com/usage' - ); - -Create a Recurring Trigger -========================== - -To have your trigger reset once every day, month, or year, pass the -`Recurring` key as part of the params array. A list of optional -trigger parameters can be found in the `Usage Triggers Documentation -`_. - -.. code-block:: php - - $client = new Services_Twilio('AC123', '456bef'); - $trigger = $client->account->usage_triggers->create( - 'totalprice', - '250.75', - 'http://example.com/usage', - array('Recurring' => 'monthly', 'TriggerBy' => 'price') - ); - diff --git a/vendor/twilio-php-master/docs/usage/taskrouter.rst b/vendor/twilio-php-master/docs/usage/taskrouter.rst deleted file mode 100644 index 79a86d6..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. _usage-taskrouter: - -================================ -Getting Started with TaskRouter -================================ -Twilio TaskRouter enables you to manage a set of Workers, a set of Tasks, and the configuration that determines how the Tasks are matched and distributed to Workers. - -Creating a TaskRouter Client -============================== - -It is necessary to first create a TaskRouter_Services_Twilio instance. You will need your Twilio account's Account Sid and Auth Token, which are available under your Twilio Account Dashboard. - -.. code-block:: php - - require 'Services/Twilio.php'; - - // set accountSid and authToken - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - - // set the workspaceSid - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - -If you do not have a workspace to specify, you can pass in **null** for the workspaceSid parameter as follows: - -.. code-block:: php - - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, null); - - -You've now got a Twilio TaskRouter Client up! You can now do things like create a worker, update a task, or reconfigure your workspace amongst other things. - diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/activities.rst b/vendor/twilio-php-master/docs/usage/taskrouter/activities.rst deleted file mode 100644 index bdafba1..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/activities.rst +++ /dev/null @@ -1,82 +0,0 @@ -=========== -Activities -=========== - -Activities describe the current status of your Workers, which determines whether they are eligible to receive task assignments. Workers are always set to a single Activity. - -Creating an Activity -============================== - -You can create a new activity by specifying its friendly name and availability. - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set activity parameters - $friendlyName = 'New Activity'; - $activityAvailability = 'false'; - - // create an activity - $activity = $taskrouterClient->workspace->activities->create( - $friendlyName, - $activityAvailability - ); - - // confirm activity created - echo "Created Activity: ".$activity->sid; - -Updating an Activity -============================== - -Updates to an activity are restricted to only the FriendlyName - -.. code-block:: php - - $activitySid = 'YOUR_ACTIVITY_SID'; - - // updated activity parameters - $updatedActivityFriendlyName = "Updated Activity Name"; - - // updated activity - $taskrouterClient->workspace->activities->get($activitySid)->update( - array( - 'FriendlyName' => $updatedActivityFriendlyName - ) - ); - - echo 'Updated Activity: '.$activitySid; - -Deleting an Activity -============================== - -Deleting an activity is just as easy as creating an activity. Simple make a call to delete and pass in the sid of the activity. - -.. code-block:: php - - $activitySid = 'YOUR_ACTIVITY_SID'; - - $taskrouterClient->workspace->activities->delete($activitySid); - - echo 'Deleted Activity: '.$activitySid; - -Get a List of all Activities -============================== - -You can also loop through the list of all activities in a workspace. - -.. code-block:: php - - foreach($taskrouterClient->workspace->activities as $activity) - { - echo $activity->sid; - } - - \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/events.rst b/vendor/twilio-php-master/docs/usage/taskrouter/events.rst deleted file mode 100644 index 3f2b302..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/events.rst +++ /dev/null @@ -1,39 +0,0 @@ -=========== -Events -=========== - -TaskRouter logs Events for each state change in the Workspace for the purpose of historical reporting and auditing. TaskRouter will also make an HTTP request containing the Event details to the Workspace's EventCallbackURL each time one these Events takes place. - -Get an Event -===================== - -You can get details on a specific event by doing the following: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $eventSid = 'YOUR_EVENT_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // fetch workspace statistics - $event = taskrouterClient->workspace->events->get($eventSid); - - -Get a List of all Events -============================== - -You can also loop through the list of all events in a workspace. - -.. code-block:: php - - foreach($taskrouterClient->workspace->events as $event) - { - echo $event->sid; - } \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/reservations.rst b/vendor/twilio-php-master/docs/usage/taskrouter/reservations.rst deleted file mode 100644 index 7114e9d..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/reservations.rst +++ /dev/null @@ -1,29 +0,0 @@ -============= -Reservations -============= - -TaskRouter creates a Task Reservation subresource whenever a Task is assigned to a Worker. TaskRouter will provide the details of this Reservation Instance subresource in the Assignment Callback HTTP request it makes to your application server. You must POST **ReservationStatus=accepted** or **ReservationStatus=rejected** to this resource within the reservation timeout to claim or reject this task. - - -Update a Reservation -======================= - -TO indicate that a Worker has accepted or rejected a Task, you can: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - $taskSid = 'YOUR_TASK_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set reservation parameters - $reservationStatus = 'accepted'; - - // update the reservation status - $taskrouterClient->workspace->tasks->get($taskSid)->reservations->get($reservationSid)->update('ReservationStatus', $reservationStatus); \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/statistics.rst b/vendor/twilio-php-master/docs/usage/taskrouter/statistics.rst deleted file mode 100644 index 4494deb..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/statistics.rst +++ /dev/null @@ -1,104 +0,0 @@ -=========== -Statistics -=========== - -TaskRouter provides real time and historical statistics for each Workspace subresource. Real time statistics allow you to check the current state of the system (tasks, workers, queues). Historical statistics allow you to analyze the efficiency of your Workflows, TaskQueues and Workers. - - -Workspace Statistics -===================== - -You can get workspace statistics by doing the following: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // fetch workspace statistics - $stats = taskrouterClient->getWorkspaceStatistics(array('Minutes' => 60)); - - // confirm stats - echo $stats->account_sid; - - -Workflow Statistics -===================== - -You can get workflow statistics by doing the following: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $workflowSid = 'YOUR_WORKFLOW_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // fetch workspace statistics - $stats = taskrouterClient->getWorkflowStatistics($workflowSid, array('Minutes' => 60)); - - // confirm stats - echo $stats->account_sid; - - -Worker Statistics -===================== - -You can get worker statistics by doing the following: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $workerSid = 'YOUR_WORKER_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // fetch workspace statistics - $stats = $taskrouterClient->getWorkerStatistics($workerSid, array('Minutes' => 60)); - - // confirm stats - echo $stats->account_sid; - - -TaskQueue Statistics -===================== - -You can get task queue statistics by doing the following: - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $taskQueueSid = 'YOUR_TASK_QUEUE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // fetch workspace statistics - $stats = $taskrouterClient->getTaskQueueStatistics($taskQueueSid, array('Minutes' => 60)); - - // confirm stats - echo $stats->account_sid; - diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/task-queues.rst b/vendor/twilio-php-master/docs/usage/taskrouter/task-queues.rst deleted file mode 100644 index 69f3d9f..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/task-queues.rst +++ /dev/null @@ -1,86 +0,0 @@ -=========== -Task Queues -=========== - -TaskQueues are the resource you use to categorize Tasks and describe which Workers are eligible to handle those Tasks. As your Workflows process Tasks, those Tasks will pass through one or more TaskQueues until the Task is assigned and accepted by an eligible Worker. - -Creating a Task Queue -============================== - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set taskQ parameters - $friendlyName = "FrenchQ"; - $assignmentActivitySid = 'YOUR_ASSIGNMENT_ACTIVITY_SID'; - $reservationActivitySid = 'YOUR_RESERVATION_ACTIVITY_SID'; - $targetWorkers = 'languages HAS "fr"'; - - $taskQ = $taskrouterClient->workspace->task_queues->create( - $friendlyName, - $assignmentActivitySid, - $reservationActivitySid, - array( - "TargetWorkers" => $targetWorkers - ) - ); - - // confirm task queue created - echo 'Created TaskQ: '.$taskQ->sid; - -Updating a Task Queue -============================== - -In this example, we update the above task queue to now accept tasks which have a language attribute of french or swedish, or both. - - -.. code-block:: php - - $taskQSid = 'YOUR_TASK_QUEUE_SID'; - - // updated taskQ parameters - $updatedFriendlyName = "French and Swedish Q"; - $updatedTargetWorkers = 'languages HAS "fr" and languages has "sv"'; - - //update taskQ - $taskrouterClient->workspace->task_queues->get($taskQSid)->update( - array( - 'FriendlyName'=> $updatedFriendlyName, - 'TargetWorkers'=> $updatedTargetWorkers - ) - ); - - echo 'Updated Task Queue: '.$taskQSid; - - -Deleting a Task Queue -============================== - -.. code-block:: php - - $taskQSid = 'YOUR_TASK_QUEUE_SID'; - - $taskrouterClient->workspace->task_queues->delete($taskQSid); - - echo 'Deleted Task Queue: '.$taskQSid; - - -Get a List of all Task Queues -============================== - -.. code-block:: php - - foreach($taskrouterClient->workspace->task_queues as $taskQ) - { - echo $taskQ->sid; - } - - \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/tasks.rst b/vendor/twilio-php-master/docs/usage/taskrouter/tasks.rst deleted file mode 100644 index e3720b1..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/tasks.rst +++ /dev/null @@ -1,86 +0,0 @@ -=========== -Tasks -=========== - -A Task instance resource represents a single item of work waiting to be processed. Tasks can represent whatever type of work is important for your team. Twilio applications can create tasks from phone calls or SMS messages. - -Creating a Task -============================== - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set task parameters - $workflowSid = 'YOUR_WORKFLOW_SID'; - $taskAttributes = '{"selected_language": "fr"}'; - $prioity = 10; - $timeout = 100; - - // create task - $task = $taskrouterClient->workspace->tasks->create( - $taskAttributes, - $workflowSid, - array( - 'Priority' => $priority, - 'Timeout' => $timeout - ) - ); - - // confirm task created - echo "Created Task: ".$task->sid; - -Updating a Task -============================== - -Here, we modify the above created task to have an updated priority of 20 and contains Swedish instead of French. - -.. code-block:: php - - $taskSid = 'YOUR_TASK_SID'; - - // update task parameters - $updatedTaskAttributes = '{"languages":"sv"}'; - $updatedPriority = 20; - - // update task - $taskrouterClient->workspace->tasks->get($taskSid)->update( - array( - 'Attributes'=> $updatedTaskAttributes, - 'Priority'=> $updatedPriority - ) - ); - - echo 'Updated Task: '.$taskSid; - - -Deleting a Task -============================== - -.. code-block:: php - - $taskSid = 'YOUR_TASK_SID'; - - $taskrouterClient->workspace->tasks->delete($taskSid); - - echo 'Deleted Task: '.$taskSid; - - -Get a List of all Tasks -============================== - -.. code-block:: php - - foreach($taskrouterClient->workspace->tasks as $task) - { - echo $task->sid; - } - - \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/workers.rst b/vendor/twilio-php-master/docs/usage/taskrouter/workers.rst deleted file mode 100644 index 4e61a6b..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/workers.rst +++ /dev/null @@ -1,81 +0,0 @@ -=========== -Workers -=========== - -Workers represent an entity that is able to perform tasks, such as an agent working in a call center, or a salesperson handling leads. - -Creating a Worker -============================== - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set worker parameters - $friendlyName = 'Bob'; - $activitySid = 'YOUR_ACTIVITY_SID'; - $workerAttributes = '{"languages":"fr"}'; - - $worker = $taskrouterClient->workspace->workers->create( - $friendlyName, - array( - 'Attributes' => $workerAttributes, - 'ActivitySid' => $idleActivitySid - ) - ); - - // confirm worker created - echo "Created Worker: ".$worker.sid; - -Updating a Worker -============================== - -This update changes the worker above to now be able to handle additional tasks, specfically, tasks that have a language attribute = "sv". - -.. code-block:: php - - $workerSid = 'YOUR_WORKER_SID'; - - // set updated worker parameters - $updatedWorkerAttributes = '{"language": ["fr", "sv"]}'; - - // update worker - $taskrouterClient->workspace->workers->get($workerSid)->update( - array( - 'Attributes' => $updatedWorkerAttributes - ) - ); - - echo 'Updated Worker: '.$workerSid; - - -Deleting a Worker -============================== - -.. code-block:: php - - $workerSid = 'YOUR_WORKER_SID'; - - $taskrouterClient->workspace->workers->delete($workerSid); - - echo 'Deleted Worker: '.$workerSid; - - -Get a List of all Workers -============================== - -.. code-block:: php - - foreach($taskrouterClient->workspace->workers as $worker) - { - echo $worker->sid; - } - - \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/workflows.rst b/vendor/twilio-php-master/docs/usage/taskrouter/workflows.rst deleted file mode 100644 index ea0a5d1..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/workflows.rst +++ /dev/null @@ -1,87 +0,0 @@ -=========== -Workflows -=========== - -Workflows control how tasks will be prioritized and routed into Queues, and how Tasks should escalate in priority or move across queues over time. Workflows are described in a simple JSON format and can be modified through the REST API or through the account portal. - -Creating a Workflow -============================== - -.. code-block:: php - - require 'Services/Twilio.php'; - - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // set workflow parameters - $friendlyName = 'Example Workflow'; - $configuration = '{"task_routing":{"default_filter":{"task_queue_sid":"YOUR_TASK_QUEUE_SID"}}}'; - $assignmentCallbackUrl = 'http://exampleCallbackUrl.org'; - $fallbackAssignmentCallbackUrl = 'http://exampleFallbackUrl.org'; - $taskReservationTimeout = 50; - - // create a Workflow - $workflow = $taskrouterClient->workspace->workflows->create( - $friendlyName, - $configuration, - $assignmentCallbackUrl, - array( - 'FallbackAssignmentCallbackUrl' => $fallbackAssignmentCallbackUrl, - 'TaskReservationTimeout' => $taskReservationTimeout - ) - ); - - // confirm workflow created - echo 'Created Workflow: '.$workflow->sid; - -Updating a Workflow -============================== - -This example updates the above workflow's configuration and task reservation timeout. - -.. code-block:: php - - $workflowSid = 'YOUR_WORKFLOW_SID'; - - // updated workflow parameters - $updatedConfiguration = '{"task_routing":{"default_filter":{"task_queue_sid" : "YOUR_UPDATED_TASK_QUEUE_SID"}}}'; - $updatedFallbackAssignmentUrl = 'http://updatedFallbackAssignmentUrl.org'; - $updatedTaskReservationTimeout = 150; - - // update workflow - $taskrouterClient->workspace->workflows->get($workflowSid)->update( - array( - 'Configuration' => $updatedConfiguration, - 'TaskReservationTimeout' => $updatedTaskReservationTimeout - ) - ); - - echo 'Updated Workflow: '.$workflowSid; - - -Deleting a Workflow -============================== - -.. code-block:: php - - $workflowSid = 'YOUR_WORKFLOW_SID'; - $taskrouterClient->workspace->workflows->delete($workflowSid); - echo 'Deleted Workflow: '.$workflowSid; - - -Get a List of all Workflows -============================== - -.. code-block:: php - - foreach($taskrouterClient->workspace->workflows as $workflow) - { - echo $workflow->sid; - } - - \ No newline at end of file diff --git a/vendor/twilio-php-master/docs/usage/taskrouter/workspaces.rst b/vendor/twilio-php-master/docs/usage/taskrouter/workspaces.rst deleted file mode 100644 index 18f01c1..0000000 --- a/vendor/twilio-php-master/docs/usage/taskrouter/workspaces.rst +++ /dev/null @@ -1,77 +0,0 @@ -=========== -Workspaces -=========== - -A Workspace is a container for your Tasks, Workers, TaskQueues, Workflows and Activities. Each of these items exists within a single Workspace and will not be shared across Workspaces. - -Creating a Workspace -============================== - -.. code-block:: php - - require 'Services/Twilio.php'; - - // set account parameters - $accountSid = 'YOUR_ACCOUNT_SID'; - $authToken = 'YOUR_AUTH_TOKEN'; - - // instantiate a Twilio TaskRouter Client - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, null); - - // create a workspace - $workspace = $taskrouterClient->createWorkspace( - $accountSid, // AccountSid - $authToken, // AuthToken - $friendlyName // name for workspace - ); - - // confirm workspace created - echo 'Created Workspace: '.$workspace->sid; - -Updating a Workspace -============================== - -This update below alters the workspace to a new FriendlyName and EventCallbackUrl. - -.. code-block:: php - - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $taskrouterClient = new TaskRouter_Services_Twilio($accountSid, $authToken, $workspaceSid); - - // updated workspace parameters - $updatedFriendlyName = 'My Updated Workspace'; - $updatedEventCallbackUrl = 'http://updatedEventCallbackUrl.org'; - - // update workspace - $taskrouterClient->workspace->update( - array( - 'FriendlyName' => $updatedFriendlyName, - 'EventCallbackUrl' => $updatedEventCallbackUrl - ) - ); - - echo 'Updated Workspace: '.$workspaceSid; - - -Deleting a Workspace -============================== - -.. code-block:: php - - $workspaceSid = 'YOUR_WORKSPACE_SID'; - - $taskrouterClient->workspaces->delete($workspaceSid); - - echo 'Deleted Workspace: '.$workspaceSid; - - -Get a List of all Workspaces -============================== - -.. code-block:: php - - foreach($taskrouterClient->workspaces as $workspace) - { - echo $workspace->sid; - } diff --git a/vendor/twilio-php-master/docs/usage/token-generation.rst b/vendor/twilio-php-master/docs/usage/token-generation.rst deleted file mode 100644 index 0d031b5..0000000 --- a/vendor/twilio-php-master/docs/usage/token-generation.rst +++ /dev/null @@ -1,64 +0,0 @@ -=========================== -Generate Capability Tokens -=========================== - -`Twilio Client `_ allows you to make and recieve connections in the browser. You can place a call to a phone on the PSTN network, all without leaving your browser. See the `Twilio Client Quickstart `_ to get up and running with Twilio Client. - -Capability tokens are used by `Twilio Client `_ to provide connection security and authorization. The `Capability Token documentation `_ explains indepth the purpose and features of these tokens. - -:php:class:`Services_Twilio_Capability` is responsible for the creation of these capability tokens. You'll need your Twilio AccountSid and AuthToken. - -.. code-block:: php - - require('/path/to/twilio-php/Services/Twilio/Capability.php'); - - $accountSid = "AC123123"; - $authToken = "secret"; - - $capability = new Services_Twilio_Capability($accountSid, $authToken); - - -Allow Incoming Connections -============================== - -Before a device running `Twilio Client `_ can recieve incoming connections, the instance must first register a name (such as "Alice" or "Bob"). The :php:meth:`allowCclientIncoming` method adds the client name to the capability token. - -.. code-block:: php - - $capability->allowClientIncoming("Alice"); - - -Allow Outgoing Connections -============================== - -To make an outgoing connection from a `Twilio Client `_ device, you'll need to choose a `Twilio Application `_ to handle TwiML URLs. A Twilio Application is a collection of URLs responsible for outputing valid TwiML to control phone calls and SMS. - -.. code-block:: php - - $applicationSid = "AP123123"; // Twilio Application Sid - $capability->allowClientOutgoing($applicationSid); - -:php:meth:`allowClientOutgoing` accepts an optional array of parameters. These parameters will be passed along when Twilio requests TwiML from the application. - -.. code-block:: php - - $applicationSid = "AP123123"; // Twilio Application Sid - $params = array("Foo" => "Bar"); // Parameters to be passed - $capability->allowClientOutgoing($applicationSid, $params); - - -Generate a Token -================== - -.. code-block:: php - - $token = $capability->generateToken(); - -By default, this token will expire in one hour. If you'd like to change the token expiration time, :php:meth:`generateToken` takes an optional argument which specifies `time to live` in seconds. - -.. code-block:: php - - $token = $capability->generateToken(600); - -This token will now expire in 10 minutes. - diff --git a/vendor/twilio-php-master/docs/usage/twiml.rst b/vendor/twilio-php-master/docs/usage/twiml.rst deleted file mode 100644 index 892735c..0000000 --- a/vendor/twilio-php-master/docs/usage/twiml.rst +++ /dev/null @@ -1,347 +0,0 @@ -.. _usage-twiml: - -============== -TwiML Creation -============== - -TwiML creation begins with the :class:`Services_Twilio_Twiml` verb. Each -succesive verb is created by calling various methods on the response, such as -:meth:`say` or :meth:`play`. These methods return the verbs they create to ease -the creation of nested TwiML. - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->say('Hello'); - print $response; - -.. code-block:: xml - - - - Hello - - -Primary Verbs -============= - -Response --------- - -All TwiML starts with the `` verb. The following code creates an empty response. - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - print $response; - -.. code-block:: xml - - - - -Say ---- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->say("Hello World"); - print $response; - -.. code-block:: xml - - - - Hello World - - -Play ----- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->play("https://api.twilio.com/cowbell.mp3", array('loop' => 5)); - print $response; - -.. code-block:: xml - - - - https://api.twilio.com/cowbell.mp3 - - -Gather ------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $gather = $response->gather(array('numDigits' => 5)); - $gather->say("Hello Caller"); - print $response; - -.. code-block:: xml - - - - - Hello Caller - - - -Record ------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->record(array( - 'action' => 'http://foo.com/path/to/redirect', - 'maxLength' => 20 - )); - print $response; - -.. code-block:: xml - - - - - - -Message -------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->message('Hello World', array( - 'to' => '+14150001111', - 'from' => '+14152223333' - )); - print $response; - -.. code-block:: xml - - - - Hello World - - -Dial ----- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->dial('+14150001111', array( - 'callerId' => '+14152223333' - )); - print $response; - -.. code-block:: xml - - - - +14150001111 - - -Number -~~~~~~ - -Dial out to phone numbers easily. - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $dial = $response->dial(NULL, array( - 'callerId' => '+14152223333' - )); - $dial->number('+14151112222', array( - 'sendDigits' => '2' - )); - print $response; - -.. code-block:: xml - - - - - +14151112222 - - - -Client -~~~~~~ - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $dial = $response->dial(NULL, array( - 'callerId' => '+14152223333' - )); - $dial->client('client-id'); - print $response; - -.. code-block:: xml - - - - - client-id - - - -Conference -~~~~~~~~~~ - -.. code-block:: php - - require("Services/Twilio.php"); - $response = new Services_Twilio_Twiml; - $dial = $response->dial(); - $dial->conference('Customer Waiting Room', array( - "startConferenceOnEnter" => "true", - "muted" => "true", - "beep" => "false", - )); - print $response; - -.. code-block:: xml - - - - - - Customer Waiting Room - - - - -Sip -~~~ - -To dial out to a Sip number, put the Sip address in the `sip()` method call. - -.. code-block:: php - - require("Services/Twilio.php"); - $response = new Services_Twilio_Twiml; - $dial = $response->dial(); - $sip = $dial->sip(); - $sip->uri('alice@foo.com?X-Header-1=value1&X-Header-2=value2', array( - "username" => "admin", - "password" => "1234", - )); - print $response; - -.. code-block:: xml - - - - - - - alice@foo.com?X-Header-1=value1&X-Header-2=value2 - - - - - - -Secondary Verbs -=============== - -Hangup ------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->hangup(); - print $response; - -.. code-block:: xml - - - - - - -Redirect --------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->redirect('http://twimlets.com/voicemail?Email=somebody@somedomain.com'); - print $response; - -.. code-block:: xml - - - - http://twimlets.com/voicemail?Email=somebody@somedomain.com - - - -Reject ------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->reject(array( - 'reason' => 'busy' - )); - print $response; - -.. code-block:: xml - - - - - - - -Pause ------ - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->say('Hello'); - $response->pause(""); - $response->say('World'); - print $response; - -.. code-block:: xml - - - - Hello - - World - - -Enqueue -------- - -.. code-block:: php - - $response = new Services_Twilio_Twiml; - $response->say("You're being added to the queue."); - $response->enqueue('queue-name'); - print $response; - -.. code-block:: xml - - - - You're being added to the queue. - queue-name - - -The verb methods (outlined in the complete reference) take the body (only text) -of the verb as the first argument. All attributes are keyword arguments. diff --git a/vendor/twilio-php-master/docs/usage/validation.rst b/vendor/twilio-php-master/docs/usage/validation.rst deleted file mode 100644 index b361f3b..0000000 --- a/vendor/twilio-php-master/docs/usage/validation.rst +++ /dev/null @@ -1,66 +0,0 @@ -=========================== -Validate Incoming Requests -=========================== - -Twilio requires that your TwiML-serving web server be open to the public. This is necessary so that Twilio can retrieve TwiML from urls and POST data back to your server. - -However, there may be people out there trying to spoof the Twilio service. Luckily, there's an easy way to validate that incoming requests are from Twilio and Twilio alone. - -An `indepth guide `_ to our security features can be found in our online documentation. - -Before you can validate requests, you'll need four pieces of information - -* your Twilio Auth Token -* the POST data for the request -* the requested URL -* the X-Twilio-Signature header value - -Get your Auth Token from the `Twilio User Dashboard `_. - -Obtaining the other three pieces of information depends on the framework of your choosing. I will assume that you have the POST data as an array and the url and X-Twilio-Signature as strings. - -The below example will print out a confirmation message if the request is actually from Twilio.com - -.. code-block:: php - - // Your auth token from twilio.com/user/account - $authToken = '12345'; - - // Download the twilio-php library from twilio.com/docs/php/install, include it - // here - require_once('/path/to/twilio-php/Services/Twilio.php'); - $validator = new Services_Twilio_RequestValidator($authToken); - - // The Twilio request URL. You may be able to retrieve this from - // $_SERVER['SCRIPT_URI'] - $url = 'https://mycompany.com/myapp.php?foo=1&bar=2'; - - // The post variables in the Twilio request. You may be able to use - // $postVars = $_POST - $postVars = array( - 'CallSid' => 'CA1234567890ABCDE', - 'Caller' => '+14158675309', - 'Digits' => '1234', - 'From' => '+14158675309', - 'To' => '+18005551212' - ); - - // The X-Twilio-Signature header - in PHP this should be - // $_SERVER["HTTP_X_TWILIO_SIGNATURE"]; - $signature = 'RSOYDt4T1cUTdK1PDd93/VVr8B8='; - - if ($validator->validate($signature, $url, $postVars)) { - echo "Confirmed to have come from Twilio."; - } else { - echo "NOT VALID. It might have been spoofed!"; - } - -Trailing Slashes -================== - -If your URL uses an "index" page, such as index.php or index.html to handle the request, such as: https://mycompany.com/twilio where the real page is served from https://mycompany.com/twilio/index.php, then Apache or PHP may rewrite that URL a little bit so it's got a trailing slash... https://mycompany.com/twilio/ for example. - -Using the code above, or similar code in another language, you could end up with an incorrect hash because, Twilio built the hash using https://mycompany.com/twilio and you may have built the hash using https://mycompany.com/twilio/. - - - diff --git a/vendor/twilio-php-master/package.php b/vendor/twilio-php-master/package.php deleted file mode 100644 index 040449a..0000000 --- a/vendor/twilio-php-master/package.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2014 Twilio - * @license http://creativecommons.org/licenses/MIT/ - * @link http://pear.php.net/package/Services_Twilio - */ - -ini_set('display_errors', '0'); -error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); -require_once 'PEAR/PackageFileManager/File.php'; -require_once 'PEAR/PackageFileManager2.php'; -PEAR::setErrorHandling(PEAR_ERROR_DIE); - -$api_version = '3.13.1'; -$api_state = 'stable'; - -$release_version = '3.13.1'; -$release_state = 'stable'; -$release_notes = 'Add TaskRouter support'; - -$description = <<setOptions( - array( - 'filelistgenerator' => 'file', - 'simpleoutput' => true, - 'baseinstalldir' => '/', - 'packagedirectory' => './', - 'dir_roles' => array( - 'Services' => 'php', - 'Services/Twilio' => 'php', - 'tests' => 'test' - ), - 'ignore' => array( - 'package.php', - '*.tgz', - 'scratch/*', - 'vendor/*', - 'composer.*', - 'coverage/*', - '.travis.yml', - 'venv/*', - ) - ) -); - - -$package->setPackage('Services_Twilio'); -$package->setSummary('PHP helper library for Twilio'); -$package->setDescription($description); -$package->setChannel('twilio-pear.herokuapp.com/pear'); -$package->setPackageType('php'); -$package->setLicense( - 'MIT License', - 'http://creativecommons.org/licenses/MIT/' -); - -$package->setNotes($release_notes); -$package->setReleaseVersion($release_version); -$package->setReleaseStability($release_state); -$package->setAPIVersion($api_version); -$package->setAPIStability($api_state); - -$package->addMaintainer( - 'lead', - 'ihumanable', - 'Matt Nowack', - 'matt@twilio.com' -); - - -$package->setPhpDep('5.2.1'); - -$package->addPackageDepWithChannel('optional', 'Mockery', 'pear.survivethedeepend.com'); - -$package->setPearInstallerDep('1.9.3'); -$package->generateContents(); -$package->addRelease(); - -if (isset($_GET['make']) - || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make') -) { - $package->writePackageFile(); -} else { - $package->debugPackageFile(); -} - diff --git a/vendor/twilio-php-master/tests/Bootstrap.php b/vendor/twilio-php-master/tests/Bootstrap.php deleted file mode 100644 index e01b873..0000000 --- a/vendor/twilio-php-master/tests/Bootstrap.php +++ /dev/null @@ -1,27 +0,0 @@ -register(); - -require_once 'Twilio.php'; - -unset($root, $library, $tests, $path); - diff --git a/vendor/twilio-php-master/tests/BuildQueryTest.php b/vendor/twilio-php-master/tests/BuildQueryTest.php deleted file mode 100644 index 5140d53..0000000 --- a/vendor/twilio-php-master/tests/BuildQueryTest.php +++ /dev/null @@ -1,56 +0,0 @@ - 'bar', - 'baz' => 'bin', - ); - - $this->assertEquals(Services_Twilio::buildQuery($data), 'foo=bar&baz=bin'); - } - - public function testSameKey() { - $data = array( - 'foo' => array( - 'bar', - 'baz', - 'bin', - ), - 'boo' => 'bah', - ); - - $this->assertEquals(Services_Twilio::buildQuery($data), - 'foo=bar&foo=baz&foo=bin&boo=bah'); - } - - public function testKeylessData() { - $data = array( - 'bar', - 'baz', - 'bin', - ); - - $this->assertEquals(Services_Twilio::buildQuery($data), '0=bar&1=baz&2=bin'); - } - - public function testKeylessDataPrefix() { - $data = array( - 'bar', - 'baz', - 'bin', - ); - - $this->assertEquals(Services_Twilio::buildQuery($data, 'var'), 'var0=bar&var1=baz&var2=bin'); - } - - public function testQualifiedUserAgent() { - $expected = Services_Twilio::USER_AGENT . " (php 5.4)"; - $this->assertEquals(Services_Twilio::qualifiedUserAgent("5.4"), $expected); - } - -} - diff --git a/vendor/twilio-php-master/tests/CapabilityTest.php b/vendor/twilio-php-master/tests/CapabilityTest.php deleted file mode 100644 index 1431450..0000000 --- a/vendor/twilio-php-master/tests/CapabilityTest.php +++ /dev/null @@ -1,106 +0,0 @@ -generateToken(), 'foo'); - $this->assertEquals($payload->iss, "AC123"); - $this->assertEquals($payload->scope, ''); - } - - public function testInboundPermissions() { - $token = new Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('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 Services_Twilio_Capability('AC123', 'foo'); - $token->allowClientIncoming('@'); - $this->fail('exception should have been raised'); - } - - function zeroLengthNameInvalid() { - $this->setExpectedException('InvalidArgumentException'); - $token = new Services_Twilio_Capability('AC123', 'foo'); - $token->allowClientIncoming(""); - $this->fail('exception should have been raised'); - } - - -} diff --git a/vendor/twilio-php-master/tests/NextGenListResourceTest.php b/vendor/twilio-php-master/tests/NextGenListResourceTest.php deleted file mode 100644 index 533c254..0000000 --- a/vendor/twilio-php-master/tests/NextGenListResourceTest.php +++ /dev/null @@ -1,65 +0,0 @@ -http = m::mock(new Services_Twilio_TinyHttp); - $this->client = new Services_Twilio('AC123', 'foobar', '2010-04-01', $this->http); - $this->client->foos = new Services_Twilio_Rest_Foos($this->client, "/Foos"); - } - - public function testGetPage() { - $this->http->shouldReceive('get')->once() - ->with('/Foos.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'foos', 'next_page_url' => null), - 'foos' => array(array('sid' => 'FO123')) - )))); - - $foos = $this->client->foos->getPage(); - $foosItems = $foos->getItems(); - $this->assertNotNull($foos); - $this->assertEquals('FO123', $foosItems[0]->sid); - } - - public function testIterator() { - $this->http->shouldReceive('get')->once() - ->with('/Foos.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'foos', 'next_page_url' => 'https://api.twilio.com/Foos.json?PageToken=NEXT'), - 'foos' => array(array('sid' => 'FO123')) - )))); - $this->http->shouldReceive('get')->once() - ->with('https://api.twilio.com/Foos.json?PageToken=NEXT') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'foos', 'next_page_url' => null), - 'foos' => array(array('sid' => 'FO456')) - )))); - $iter = $this->client->foos->getIterator(); - $this->assertNotNull($iter); - $this->assertTrue($iter->valid()); - $foo = $iter->current(); - $this->assertNotNull($foo); - $this->assertEquals('FO123', $foo->sid); - $iter->next(); - $iter->valid(); - $foo = $iter->current(); - $this->assertNotNull($foo); - $this->assertEquals('FO456', $foo->sid); - } -} diff --git a/vendor/twilio-php-master/tests/README b/vendor/twilio-php-master/tests/README deleted file mode 100644 index 2392c33..0000000 --- a/vendor/twilio-php-master/tests/README +++ /dev/null @@ -1,3 +0,0 @@ -# To run the tests, navigate to the twilio-php home directory, then run: - -make test diff --git a/vendor/twilio-php-master/tests/RequestValidatorTest.php b/vendor/twilio-php-master/tests/RequestValidatorTest.php deleted file mode 100644 index e38a668..0000000 --- a/vendor/twilio-php-master/tests/RequestValidatorTest.php +++ /dev/null @@ -1,48 +0,0 @@ - "94612", - "AccountSid" => "AC9a9f9392lad99kla0sklakjs90j092j3", - "ApiVersion" => "2010-04-01", - "CallSid" => "CAd800bb12c0426a7ea4230e492fef2a4f", - "CallStatus" => "ringing", - "Called" => "+15306384866", - "CalledCity" => "OAKLAND", - "CalledCountry" => "US", - "CalledState" => "CA", - "Caller" => "+15306666666", - "CallerCity" => "SOUTH LAKE TAHOE", - "CallerCountry" => "US", - "CallerName" => "CA Wireless Call", - "CallerState" => "CA", - "CallerZip" => "89449", - "Direction" => "inbound", - "From" => "+15306666666", - "FromCity" => "SOUTH LAKE TAHOE", - "FromCountry" => "US", - "FromState" => "CA", - "FromZip" => "89449", - "To" => "+15306384866", - "ToCity" => "OAKLAND", - "ToCountry" => "US", - "ToState" => "CA", - "ToZip" => "94612", - ); - - $expected = "fF+xx6dTinOaCdZ0aIeNkHr/ZAA="; - - $this->assertEquals( - $validator->computeSignature($uri, $params), $expected); - $this->assertTrue($validator->validate($expected, $uri, $params)); - } - -} diff --git a/vendor/twilio-php-master/tests/TwilioTest.php b/vendor/twilio-php-master/tests/TwilioTest.php deleted file mode 100644 index 7ef7539..0000000 --- a/vendor/twilio-php-master/tests/TwilioTest.php +++ /dev/null @@ -1,757 +0,0 @@ - 'application/x-www-form-urlencoded'); - protected $callParams = array('To' => '123', 'From' => '123', 'Url' => 'http://example.com'); - protected $nginxError = array(500, array('Content-Type' => 'text/html'), - 'Nginx 500 error' - ); - protected $pagingParams = array('Page' => '0', 'PageSize' => '10'); - - function tearDown() { - m::close(); - } - - function getClient($http) { - return new Services_Twilio('AC123', '123', '2010-04-01', $http); - } - - function createMockHttp($url, $method, $response, $params = null, - $status = 200 - ) { - $http = m::mock(new Services_Twilio_TinyHttp); - if ($method === 'post') { - $http->shouldReceive('post')->once()->with( - "/2010-04-01/Accounts/AC123$url.json", - $this->formHeaders, - http_build_query($params) - )->andReturn(array( - $status, - array('Content-Type' => 'application/json'), - json_encode($response) - ) - ); - } else { - $query = empty($params) ? '' : '?' . http_build_query($params); - $http->shouldReceive($method)->once()->with( - "/2010-04-01/Accounts/AC123$url.json$query" - )->andReturn(array( - $status, - array('Content-Type' => 'application/json'), - json_encode($response) - ) - ); - } - return $http; - } - - /** - * @dataProvider uriTestProvider - */ - function testRequestUriConstructedProperly($path, $params, $full_uri, $expected) { - $client = new Services_Twilio('sid', 'token'); - $actual = $client->getRequestUri($path, $params, $full_uri); - $this->assertSame($expected, $actual); - } - - function uriTestProvider() { - return array( - array( - '/2010-04-01/Accounts', - array('FriendlyName' => 'hi'), - false, - '/2010-04-01/Accounts.json?FriendlyName=hi', - ), - array( - '/2010-04-01/Accounts', - array(), - false, - '/2010-04-01/Accounts.json', - ), - array( - '/2010-04-01/Accounts.json', - array(), - true, - '/2010-04-01/Accounts.json', - ), - array( - '/2010-04-01/Accounts.json', - array('FriendlyName' => 'hi'), - true, - '/2010-04-01/Accounts.json', - ), - array( - '/2010-04-01/Accounts', - array( - 'FriendlyName' => 'hi', - 'foo' => 'bar', - ), - false, - '/2010-04-01/Accounts.json?FriendlyName=hi&foo=bar', - ), - ); - } - - /** - * @dataProvider nextGenUriProvider - */ - function testLookupsRequestUriConstructedProperly($path, $params, $full_uri, $expected) { - $client = new Lookups_Services_Twilio('sid', 'token'); - $actual = $client->getRequestUri($path, $params, $full_uri); - $this->assertSame($expected, $actual); - } - - /** - * @dataProvider nextGenUriProvider - */ - function testTaskRouterRequestUriConstructedProperly($path, $params, $full_uri, $expected) { - $client = new TaskRouter_Services_Twilio('sid', 'token', 'sid'); - $actual = $client->getRequestUri($path, $params, $full_uri); - $this->assertSame($expected, $actual); - } - - function nextGenUriProvider() { - return array( - array( - '/v1/Resource', - array('FriendlyName' => 'hi'), - false, - '/v1/Resource?FriendlyName=hi', - ), - array( - '/v1/Resource', - array(), - false, - '/v1/Resource', - ), - array( - '/v1/Resource', - array(), - true, - '/v1/Resource', - ), - array( - '/v1/Resource', - array('FriendlyName' => 'hi'), - true, - '/v1/Resource', - ), - array( - '/v1/Resource', - array( - 'FriendlyName' => 'hi', - 'foo' => 'bar', - ), - false, - '/v1/Resource?FriendlyName=hi&foo=bar', - ), - ); - } - - function testNeedsRefining() { - $http = $this->createMockHttp('', 'get', array( - 'sid' => 'AC123', - 'friendly_name' => 'Robert Paulson', - ) - ); - $client = $this->getClient($http); - $this->assertEquals('AC123', $client->account->sid); - $this->assertEquals('Robert Paulson', $client->account->friendly_name); - } - - function testAccessSidAvoidsNetworkCall() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->never(); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->sid; - } - - function testOnlyOneClientCreated() { - $client = new Services_Twilio('AC123', '456'); - $client->account->client->sid = 'CL456'; - $this->assertSame('CL456', $client->account->sandbox->client->sid); - } - - function testNullVersionReturnsNewest() { - $client = new Services_Twilio('AC123', '123', null); - $this->assertEquals('2010-04-01', $client->getVersion()); - $client = new Services_Twilio('AC123', '123', 'v1'); - $this->assertEquals('2010-04-01', $client->getVersion()); - $client = new Services_Twilio('AC123', '123', '2010-04-01'); - $this->assertEquals('2010-04-01', $client->getVersion()); - $client = new Services_Twilio('AC123', '123', '2008-08-01'); - $this->assertEquals('2008-08-01', $client->getVersion()); - } - - function testObjectLoadsOnlyOnce() { - $http = $this->createMockHttp('', 'get', array( - 'sid' => 'AC123', - 'friendly_name' => 'Robert Paulson', - 'status' => 'active', - )); - $client = $this->getClient($http); - $client->account->friendly_name; - $client->account->friendly_name; - $client->account->status; - } - - function testSubresourceLoad() { - $http = $this->createMockHttp('/Calls/CA123', 'get', - array('status' => 'Completed') - ); - $client = $this->getClient($http); - $this->assertEquals( - 'Completed', - $client->account->calls->get('CA123')->status - ); - } - - function testSubresourceSubresource() { - $http = $this->createMockHttp('/Calls/CA123/Notifications/NO123', 'get', - array('message_text' => 'Foo') - ); - - $client = $this->getClient($http); - $notifs = $client->account->calls->get('CA123')->notifications; - $this->assertEquals('Foo', $notifs->get('NO123')->message_text); - } - - function testGetIteratorUsesFilters() { - $params = array_merge($this->pagingParams, array( - 'StartTime>' => '2012-07-06', - )); - $response = array( - 'total' => 1, - 'calls' => array(array('status' => 'Completed', 'sid' => 'CA123')) - ); - $http = $this->createMockHttp('/Calls', 'get', $response, $params); - $client = $this->getClient($http); - - $iterator = $client->account->calls->getIterator( - 0, 10, array('StartTime>' => '2012-07-06')); - foreach ($iterator as $call) { - $this->assertEquals('Completed', $call->status); - break; - } - } - - function testListResource() { - $response = array( - 'total' => 1, - 'calls' => array(array('status' => 'completed', 'sid' => 'CA123')) - ); - $http = $this->createMockHttp('/Calls', 'get', $response, - $this->pagingParams); - $client = $this->getClient($http); - - $page = $client->account->calls->getPage(0, 10); - $call = current($page->getItems()); - $this->assertEquals('completed', $call->status); - $this->assertEquals(1, $page->total); - } - - function testInstanceResourceUriConstructionFromList() { - $response = array( - 'total' => 1, - 'calls' => array(array( - 'status' => 'in-progress', - 'sid' => 'CA123', - 'uri' => 'junk_uri' - )) - ); - $http = $this->createMockHttp('/Calls', 'get', $response, - $this->pagingParams); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Calls/CA123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'status' => 'completed' - )) - )); - $client = $this->getClient($http); - $page = $client->account->calls->getPage(0, 10); - $call = current($page->getItems()); - - /* trigger api fetch by trying to retrieve nonexistent var */ - try { - $call->nonexistent; - } catch (Exception $e) { - // pass - } - $this->assertSame($call->status, 'completed'); - } - - function testInstanceResourceUriConstructionFromGet() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/PN123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'sms_method' => 'POST', - 'sid' => 'PN123', - 'uri' => 'junk_uri', - )) - )); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/PN123.json', - $this->formHeaders, 'SmsMethod=GET') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'sms_method' => 'GET', - 'sid' => 'PN123', - 'uri' => 'junk_uri' - )) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $number = $client->account->incoming_phone_numbers->get('PN123'); - $this->assertSame($number->sms_method, 'POST'); - - $number->update(array('SmsMethod' => 'GET')); - $this->assertSame($number->sms_method, 'GET'); - } - - function testIterateOverPage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Calls.json?Page=0&PageSize=10') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'total' => 1, - 'calls' => array(array('status' => 'Completed', 'sid' => 'CA123')) - )) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $page = $client->account->calls->getPage(0, 10); - foreach ($page->getIterator() as $pageitems) { - $this->assertSame('CA123', $pageitems->sid); - } - } - - function testAsymmetricallyNamedResources() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages.json?Page=0&PageSize=10') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sms_messages' => array( - array('status' => 'sent', 'sid' => 'SM123') - ))) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $sms = current($client->account->sms_messages->getPage(0, 10)->getItems()); - $this->assertEquals('sent', $sms->status); - } - - function testParams() { - $http = m::mock(new Services_Twilio_TinyHttp); - $qs = 'Page=0&PageSize=10&FriendlyName=foo&Status=active'; - $http->shouldReceive('get') - ->with('/2010-04-01/Accounts.json?' . $qs) - ->andReturn(array( - 200, - array('Content-Type' => 'application/json'), - '{"accounts":[]}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->accounts->getPage(0, 10, array( - 'FriendlyName' => 'foo', - 'Status' => 'active', - )); - } - - function testUpdate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once()->with( - '/2010-04-01/Accounts/AC123/Calls.json', $this->formHeaders, - http_build_query($this->callParams) - )->andReturn( - array(200, array('Content-Type' => 'application/json'), - '{"sid":"CA123"}') - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->calls->create('123', '123', 'http://example.com'); - } - - function testPricingClient() { - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1'); - $this->assertNotNull($pricingClient); - $this->assertEquals(1, $pricingClient->getRetryAttempts()); - } - - function testTaskRouterClient() { - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1'); - $this->assertNotNull($taskrouterClient); - $this->assertEquals(1, $taskrouterClient->getRetryAttempts()); - $this->assertNotNull($taskrouterClient->workspaces); - $this->assertEquals('WS123', $taskrouterClient->workspace->sid); - } - - function testLookupsClient() { - $lookupsClient = new Lookups_Services_Twilio('AC123', '123', 'v1'); - $this->assertNotNull($lookupsClient); - $this->assertEquals(1, $lookupsClient->getRetryAttempts()); - $this->assertEquals('v1', $lookupsClient->getVersion()); - } - - function testModifyLiveCall() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once()->with( - '/2010-04-01/Accounts/AC123/Calls.json', $this->formHeaders, - http_build_query($this->callParams) - )->andReturn( - array(200, array('Content-Type' => 'application/json'), - '{"sid":"CA123"}') - ); - $http->shouldReceive('post')->once()->with( - '/2010-04-01/Accounts/AC123/Calls/CA123.json', - $this->formHeaders, - 'Status=completed' - )->andReturn( - array(200, array('Content-Type' => 'application/json'), - '{"sid":"CA123"}' - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $calls = $client->account->calls; - $call = $calls->create('123', '123', 'http://example.com'); - $call->hangup(); - } - - function testUnmute() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with( - '/2010-04-01/Accounts/AC123/Conferences/CF123/Participants.json?Page=0&PageSize=10') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'participants' => array(array('call_sid' => 'CA123')) - )) - )); - $http->shouldReceive('post')->once() - ->with( - '/2010-04-01/Accounts/AC123/Conferences/CF123/Participants/CA123.json', - $this->formHeaders, - 'Muted=true' - )->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array()) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $conf = $client->account->conferences->get('CF123'); - $page = $conf->participants->getPage(0, 10); - foreach ($page->getItems() as $participant) { - $participant->mute(); - } - } - - function testResourcePropertiesReflectUpdates() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'foo')) - )); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123.json', $this->formHeaders, 'FriendlyName=bar') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'bar')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $this->assertEquals('foo', $client->account->friendly_name); - $client->account->update('FriendlyName', 'bar'); - $this->assertEquals('bar', $client->account->friendly_name); - } - - //function testAccessingNonExistentPropertiesErrorsOut - - function testArrayAccessForListResources() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Calls.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'calls' => array(array('sid' => 'CA123')) - )) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Calls.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - foreach ($client->account->calls as $call) { - $this->assertEquals('CA123', $call->sid); - } - $this->assertInstanceOf('Traversable', $client->account->calls); - } - - function testDeepPagingUsesAfterSid() { - $http = m::mock(new Services_Twilio_TinyHttp); - $callsBase = '/2010-04-01/Accounts/AC123/Calls.json'; - $firstPageUri = $callsBase . '?Page=0&PageSize=1'; - $afterSidUri = $callsBase . '?Page=1&PageSize=1&AfterSid=CA123'; - $secondAfterSidUri = $callsBase . '?Page=2&PageSize=1&AfterSid=CA456'; - $http->shouldReceive('get')->once() - ->with($firstPageUri) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'next_page_uri' => $afterSidUri, - 'calls' => array(array( - 'sid' => 'CA123', - 'price' => '-0.02000', - )) - )) - )); - $http->shouldReceive('get')->once() - ->with($afterSidUri) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'next_page_uri' => $secondAfterSidUri, - 'calls' => array(array( - 'sid' => 'CA456', - 'price' => '-0.02000', - )) - )) - )); - $http->shouldReceive('get')->once() - ->with($secondAfterSidUri) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'next_page_uri' => null, - 'calls' => array(array( - 'sid' => 'CA789', - 'price' => '-0.02000', - )) - )) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Calls.json?Page=3&PageSize=1') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - foreach ($client->account->calls->getIterator(0, 1) as $call) { - $this->assertSame($call->price, '-0.02000'); - } - } - - function testIteratorWithFiltersPagesCorrectly() { - $http = m::mock(new Services_Twilio_TinyHttp); - $recordingsBase = '/2010-04-01/Accounts/AC123/Recordings.json'; - $firstPageUri = $recordingsBase . '?Page=0&PageSize=1&DateCreated%3E=2011-01-01'; - $secondPageUri = $recordingsBase . '?DateCreated%3E=2011-01-01&Page=1&PageSize=1'; - $thirdPageUri = $recordingsBase . '?DateCreated%3E=2011-01-01&Page=2&PageSize=1'; - $http->shouldReceive('get')->once() - ->with($firstPageUri) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'next_page_uri' => $secondPageUri, - 'recordings' => array(array( - 'sid' => 'RE123', - 'duration' => 7, - )) - )) - )); - $http->shouldReceive('get')->once() - ->with($secondPageUri) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'next_page_uri' => $thirdPageUri, - 'recordings' => array(array( - 'sid' => 'RE123', - 'duration' => 7, - )) - )) - )); - $http->shouldReceive('get')->once() - ->with($thirdPageUri) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - foreach ($client->account->recordings->getIterator(0, 1, array('DateCreated>' => '2011-01-01')) as $recording) { - $this->assertSame($recording->duration, 7); - } - } - - function testRetryOn500() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('price' => 0.5)) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $message = $client->account->sms_messages->get('SM123'); - $this->assertSame($message->price, 0.5); - } - - function testDeleteOn500() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn( - array(204, array('Content-Type' => 'application/json'), '') - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->sms_messages->delete('SM123'); - } - - function testSetExplicitRetryLimit() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('price' => 0.5)) - ) - ); - // retry twice - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http, 2); - $message = $client->account->sms_messages->get('SM123'); - $this->assertSame($message->price, 0.5); - } - - function testRetryLimitIsHonored() { - $this->setExpectedException('Services_Twilio_RestException'); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn($this->nginxError); - $http->shouldReceive('get')->never() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages/SM123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('price' => 0.5)) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $message = $client->account->sms_messages->get('SM123'); - $this->assertSame($message->price, 0.5); - } - - function testRetryIdempotentFunctionsOnly() { - $this->setExpectedException('Services_Twilio_RestException'); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages.json', $this->formHeaders, - 'From=%2B14105551234&To=%2B14102221234&Body=bar') - ->andReturn($this->nginxError); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $message = $client->account->sms_messages->create('+14105551234', - '+14102221234', 'bar'); - } - - function testExceptionUsesHttpStatus() { - $http = $this->createMockHttp('/Queues/QU123/Members/Front', 'post', - array(), array('Url' => 'http://google.com'), 400); - $client = $this->getClient($http); - try { - $front = $client->account->queues->get('QU123')->members->front(); - $front->update(array('Url' => 'http://google.com')); - $this->fail('should throw rest exception before reaching this line.'); - } catch (Services_Twilio_RestException $e) { - $this->assertSame($e->getStatus(), 400); - $this->assertSame($e->getMessage(), ''); - } - } - - function testUnicode() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages.json', $this->formHeaders, - 'From=123&To=123&Body=Hello+%E2%98%BA') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $message = $client->account->sms_messages->create('123', '123', - 'Hello ☺'); - $this->assertSame($message->sid, 'SM123'); - } - - function testCreateWorkspace() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Workspaces', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Workspace') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WS123')) - )); - $workspace = TaskRouter_Services_Twilio::createWorkspace('AC123', '123', 'Test Workspace', array(), $http); - $this->assertNotNull($workspace); - } - - function testPostMultivaluedForm() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=123&To=123&MediaUrl=http%3A%2F%2Fexample.com%2Fimage1&MediaUrl=http%3A%2F%2Fexample.com%2Fimage2') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $message = $client->account->messages->sendMessage('123', '123', null, - array('http://example.com/image1', 'http://example.com/image2') - ); - $this->assertSame($message->sid, 'SM123'); - } - - function testToString() { - $http = m::mock(new Services_Twilio_TinyHttp); - $resp = <<assertSame((string)$sampleMessage, $expected); - } - - function testSubresourceUris() { - $http = m::mock(new Services_Twilio_TinyHttp); - $call = new Services_Twilio_Rest_Call($http, '/foo'); - $recordings = $call->subresources['recordings']; - $this->assertSame($recordings->uri, '/foo/Recordings'); - } -} diff --git a/vendor/twilio-php-master/tests/TwimlTest.php b/vendor/twilio-php-master/tests/TwimlTest.php deleted file mode 100644 index d606bf7..0000000 --- a/vendor/twilio-php-master/tests/TwimlTest.php +++ /dev/null @@ -1,377 +0,0 @@ -'; - $this->assertXmlStringEqualsXmlString($expected, $r, - "Should be an empty response"); - } - - public function testSayBasic() { - $r = new Services_Twilio_Twiml(); - $r->say("Hello Monkey"); - $expected = 'Hello Monkey'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayLoopThree() { - $r = new Services_Twilio_Twiml(); - $r->say("Hello Monkey", array("loop" => 3)); - $expected = 'Hello Monkey'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayLoopThreeWoman() { - $r = new Services_Twilio_Twiml(); - $r->say("Hello Monkey", array("loop" => 3, "voice"=>"woman")); - $expected = '' - . 'Hello Monkey'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayConvienceMethod() { - $r = new Services_Twilio_Twiml(); - $r->say("Hello Monkey", array("language" => "fr")); - $expected = '' - . 'Hello Monkey'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayUTF8() { - $r = new Services_Twilio_Twiml(); - $r->say("é tü & må"); - $expected = '' - . 'é tü & må'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayNamedEntities() { - $r = new Services_Twilio_Twiml(); - $r->say("é tü & må"); - $expected = '' - . 'é tü & må'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSayNumericEntities() { - $r = new Services_Twilio_Twiml(); - $r->say("é tü & må"); - $expected = '' - . 'é tü & må'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testPlayBasic() { - $r = new Services_Twilio_Twiml(); - $r->play("hello-monkey.mp3"); - $expected = 'hello-monkey.mp3'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testPlayLoopThree() { - $r = new Services_Twilio_Twiml(); - $r->play("hello-monkey.mp3", array("loop" => 3)); - $expected = '' - . 'hello-monkey.mp3'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testPlayConvienceMethod() { - $r = new Services_Twilio_Twiml(); - $r->play("hello-monkey.mp3", array("loop" => 3)); - $expected = '' - . 'hello-monkey.mp3'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Record Verb - public function testRecord() { - $r = new Services_Twilio_Twiml(); - $r->record(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testRecordActionMethod() { - $r = new Services_Twilio_Twiml(); - $r->record(array("action" => "example.com", "method" => "GET")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testBooleanBecomesString() { - $r = new Services_Twilio_Twiml(); - $r->record(array("transcribe" => true)); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testRecordMaxLengthKeyTimeout(){ - $r = new Services_Twilio_Twiml(); - $r->record(array("timeout" => 4, "finishOnKey" => "#", - "maxLength" => 30)); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testRecordConvienceMethod(){ - $r = new Services_Twilio_Twiml(); - $r->record(array("transcribeCallback" => "example.com")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testRecordAddAttribute(){ - $r = new Services_Twilio_Twiml(); - $r->record(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Redirect Verb - public function testRedirect() { - $r = new Services_Twilio_Twiml(); - $r->redirect(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testAmpersandEscaping() { - $r = new Services_Twilio_Twiml(); - $test_amp = "test&two&three"; - $r->redirect($test_amp); - $expected = '' . - 'test&two&three'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testRedirectConvience() { - $r = new Services_Twilio_Twiml(); - $r->redirect(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - public function testRedirectAddAttribute(){ - $r = new Services_Twilio_Twiml(); - $r->redirect(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Hangup Verb - public function testHangup() { - $r = new Services_Twilio_Twiml(); - $r->hangup(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testHangupConvience() { - $r = new Services_Twilio_Twiml(); - $r->hangup(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testHangupAddAttribute(){ - $r = new Services_Twilio_Twiml(); - $r->hangup(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Pause Verb - public function testPause() { - $r = new Services_Twilio_Twiml(); - $r->pause(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testPauseConvience() { - $r = new Services_Twilio_Twiml(); - $r->pause(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testPauseAddAttribute(){ - $r = new Services_Twilio_Twiml(); - $r->pause(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Dial Verb - public function testDial() { - $r = new Services_Twilio_Twiml(); - $r->dial("1231231234"); - $expected = '1231231234'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testDialConvience() { - $r = new Services_Twilio_Twiml(); - $r->dial(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testDialAddNumber() { - $r = new Services_Twilio_Twiml(); - $d = $r->dial(); - $d->number("1231231234"); - $expected = '' - . '1231231234'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testDialAddConference() { - $r = new Services_Twilio_Twiml(); - $d = $r->dial(); - $d->conference("MyRoom"); - $expected = '' - . 'MyRoom'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testDialAddConferenceConvience() { - $r = new Services_Twilio_Twiml(); - $d = $r->dial(); - $d->conference("MyRoom", array("startConferenceOnEnter" => "false")); - $expected = 'MyRoom'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testDialAddAttribute() { - $r = new Services_Twilio_Twiml(); - $r->dial(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - //Test Gather Verb - public function testGather() { - $r = new Services_Twilio_Twiml(); - $r->gather(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testGatherMethodAction(){ - $r = new Services_Twilio_Twiml(); - $r->gather(array("action"=>"example.com", "method"=>"GET")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testGatherActionWithParams(){ - $r = new Services_Twilio_Twiml(); - $r->gather(array("action" => "record.php?action=recordPageNow" - . "&id=4&page=3")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testGatherNestedVerbs(){ - $r = new Services_Twilio_Twiml(); - $g = $r->gather(array("action"=>"example.com", "method"=>"GET")); - $g->say("Hello World"); - $g->play("helloworld.mp3"); - $g->pause(); - $expected = ' - - - Hello World - helloworld.mp3 - - - '; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testGatherNestedVerbsConvienceMethods(){ - $r = new Services_Twilio_Twiml(); - $g = $r->gather(array("action"=>"example.com", "method"=>"GET")); - $g->say("Hello World"); - $g->play("helloworld.mp3"); - $g->pause(); - $expected = ' - - - Hello World - helloworld.mp3 - - - '; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testGatherAddAttribute(){ - $r = new Services_Twilio_Twiml(); - $r->gather(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSms() { - $r = new Services_Twilio_Twiml(); - $r->sms("Hello World"); - $expected = 'Hello World'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSmsConvience() { - $r = new Services_Twilio_Twiml(); - $r->sms("Hello World"); - $expected = 'Hello World'; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testSmsAddAttribute() { - $r = new Services_Twilio_Twiml(); - $r->sms(array("foo" => "bar")); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - public function testReject() { - $r = new Services_Twilio_Twiml(); - $r->reject(); - $expected = ''; - $this->assertXmlStringEqualsXmlString($expected, $r); - } - - function testGeneration() { - - $r = new Services_Twilio_Twiml(); - $r->say('hello'); - $r->dial()->number('123', array('sendDigits' => '456')); - $r->gather(array('timeout' => 15)); - - $doc = simplexml_load_string($r); - $this->assertEquals('Response', $doc->getName()); - $this->assertEquals('hello', (string) $doc->Say); - $this->assertEquals('456', (string) $doc->Dial->Number['sendDigits']); - $this->assertEquals('123', (string) $doc->Dial->Number); - $this->assertEquals('15', (string) $doc->Gather['timeout']); - } - -} diff --git a/vendor/twilio-php-master/tests/phpunit.xml b/vendor/twilio-php-master/tests/phpunit.xml deleted file mode 100644 index ebfe3cf..0000000 --- a/vendor/twilio-php-master/tests/phpunit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - ./ - - - diff --git a/vendor/twilio-php-master/tests/resources/AccountsTest.php b/vendor/twilio-php-master/tests/resources/AccountsTest.php deleted file mode 100644 index 65f9b83..0000000 --- a/vendor/twilio-php-master/tests/resources/AccountsTest.php +++ /dev/null @@ -1,29 +0,0 @@ - 'application/x-www-form-urlencoded'); - function testPost() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts.json', - $this->formHeaders, 'FriendlyName=foo') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'AC345')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $account = $client->accounts->create(array( - 'FriendlyName' => 'foo', - )); - $this->assertEquals('AC345', $account->sid); - } - - function tearDown() - { - m::close(); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/ApplicationsTest.php b/vendor/twilio-php-master/tests/resources/ApplicationsTest.php deleted file mode 100644 index ff87675..0000000 --- a/vendor/twilio-php-master/tests/resources/ApplicationsTest.php +++ /dev/null @@ -1,28 +0,0 @@ - 'application/x-www-form-urlencoded'); - function testPost() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Applications.json', - $this->formHeaders, 'FriendlyName=foo&VoiceUrl=bar') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'AP123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $app = $client->account->applications->create('foo', array( - 'VoiceUrl' => 'bar', - )); - $this->assertEquals('AP123', $app->sid); - } - - function tearDown() - { - m::close(); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/AvailablePhoneNumbersTest.php b/vendor/twilio-php-master/tests/resources/AvailablePhoneNumbersTest.php deleted file mode 100644 index 441f46b..0000000 --- a/vendor/twilio-php-master/tests/resources/AvailablePhoneNumbersTest.php +++ /dev/null @@ -1,57 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/AvailablePhoneNumbers/US/Local.json?AreaCode=510') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('available_phone_numbers' => array( - 'friendly_name' => '(510) 564-7903' - ))) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $nums = $client->account->available_phone_numbers->getLocal('US'); - $numsList = $nums->getList(array('AreaCode' => '510')); - foreach ($numsList as $num) { - $this->assertEquals('(510) 564-7903', $num->friendly_name); - } - } - - function testPagePhoneNumberResource() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/AvailablePhoneNumbers.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'total' => 1, - 'countries' => array(array('country_code' => 'CA')) - )) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $page = $client->account->available_phone_numbers->getPage('0'); - $this->assertEquals('CA', $page->countries[0]->country_code); - } - - function testGetMobile() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/AvailablePhoneNumbers/GB/Mobile.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('available_phone_numbers' => array( - 'friendly_name' => '(510) 564-7903' - ))) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $nums = $client->account->available_phone_numbers->getMobile('GB')->getList(); - foreach ($nums as $num) { - $this->assertEquals('(510) 564-7903', $num->friendly_name); - } - } - - function tearDown() { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/CallsTest.php b/vendor/twilio-php-master/tests/resources/CallsTest.php deleted file mode 100644 index 3759cf4..0000000 --- a/vendor/twilio-php-master/tests/resources/CallsTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertEquals($expected, $result); - } - - function sidProvider() - { - return array( - array("AP2a0747eba6abf96b7e3c3ff0b4530f6e", true), - array("CA2a0747eba6abf96b7e3c3ff0b4530f6e", false), - array("AP2a0747eba6abf96b7e3c3ff0b4530f", false), - array("http://www.google.com/asdfasdfAP", false), - ); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/ConnectAppsTest.php b/vendor/twilio-php-master/tests/resources/ConnectAppsTest.php deleted file mode 100644 index 7cda220..0000000 --- a/vendor/twilio-php-master/tests/resources/ConnectAppsTest.php +++ /dev/null @@ -1,54 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/ConnectApps/CN123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'foo')) - )); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/ConnectApps/CN123.json', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Bar') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'Bar')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $cn = $client->account->connect_apps->get('CN123'); - $this->assertEquals('foo', $cn->friendly_name); - $cn->update(array('FriendlyName' => 'Bar')); - $this->assertEquals('Bar', $cn->friendly_name); - } - - function testUpdateWithOneParam() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/ConnectApps/CN123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'foo')) - )); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/ConnectApps/CN123.json', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Bar') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('friendly_name' => 'Bar')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $cn = $client->account->connect_apps->get('CN123'); - $this->assertEquals('foo', $cn->friendly_name); - $cn->update('FriendlyName', 'Bar'); - $this->assertEquals('Bar', $cn->friendly_name); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/FeedbackSummaryTest.php b/vendor/twilio-php-master/tests/resources/FeedbackSummaryTest.php deleted file mode 100644 index b6a6002..0000000 --- a/vendor/twilio-php-master/tests/resources/FeedbackSummaryTest.php +++ /dev/null @@ -1,94 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreateFeedbackSummary() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/FeedbackSummary.json', self::$formHeaders, - 'StartDate=2014-01-01&EndDate=2014-01-31&IncludeSubaccounts=1&StatusCallback=http%3A%2F%2Fwww.example.com%2Ffeedback') - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array( - 'sid' => 'FSa346467ca321c71dbd5e12f627deb854', - 'start_date' => '2014-01-01', - 'end_date' => '2014-01-31', - 'account_sid' => self::$accountSid, - 'include_subaccounts' => true, - 'status' => 'queued', - 'call_count' => null, - 'call_feedback_count' => null, - 'quality_score_average' => null, - 'quality_score_median' => null, - 'quality_score_standard_deviation' => null, - 'issues' => null, - 'date_created' => 'Thu, 19 Aug 2010 00:25:48 +0000', - 'date_updated' => 'Thu, 19 Aug 2010 00:25:48 +0000' - )) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedbackSummary = $client->account->calls->feedback_summary->create(array('StartDate' => '2014-01-01', - 'EndDate' => '2014-01-31', - 'IncludeSubaccounts' => true, - 'StatusCallback' => 'http://www.example.com/feedback')); - $this->assertEquals(self::$feedbackSummarySid, $feedbackSummary->sid); - $this->assertEquals('2014-01-01', $feedbackSummary->start_date); - $this->assertEquals('2014-01-31', $feedbackSummary->end_date); - $this->assertEquals(0, count($feedbackSummary->issues)); - } - - function testDeleteFeedbackSummary() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/FeedbackSummary/'. self::$feedbackSummarySid .'.json') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '')); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedbackSummary = $client->account->calls->feedback_summary->delete(self::$feedbackSummarySid); - $this->assertNull($feedbackSummary); - } - - function testGetFeedbackSummary() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/FeedbackSummary/' . self::$feedbackSummarySid . '.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'sid' => 'FSa346467ca321c71dbd5e12f627deb854', - 'start_date' => '2014-01-01', - 'end_date' => '2014-01-31', - 'account_sid' => self::$accountSid, - 'include_subaccounts' => true, - 'status' => 'completed', - 'call_count' => 10200, - 'call_feedback_count' => 729, - 'quality_score_average' => 4.5, - 'quality_score_median' => 4, - 'quality_score_standard_deviation' => 1, - 'issues' => array(array('description' => 'imperfect-audio', 'count' => 45, 'percentage_of_total_calls' => '0.04%')), - 'date_created' => 'Thu, 19 Aug 2010 00:25:48 +0000', - 'date_updated' => 'Thu, 19 Aug 2010 00:25:48 +0000' - )) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedbackSummary = $client->account->calls->feedback_summary->get(self::$feedbackSummarySid); - $this->assertEquals(self::$feedbackSummarySid, $feedbackSummary->sid); - $this->assertEquals('2014-01-01', $feedbackSummary->start_date); - $this->assertEquals('2014-01-31', $feedbackSummary->end_date); - $this->assertEquals('completed', $feedbackSummary->status); - $this->assertEquals(1, count($feedbackSummary->issues)); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/FeedbackTest.php b/vendor/twilio-php-master/tests/resources/FeedbackTest.php deleted file mode 100644 index 3d2f65b..0000000 --- a/vendor/twilio-php-master/tests/resources/FeedbackTest.php +++ /dev/null @@ -1,97 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreateFeedback() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json', self::$formHeaders, - 'QualityScore=5&Issue=post-dial-delay&Issue=another-issue') - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array('quality_score' => 5, 'issues' => array('post-dial-delay', 'another-issue'))) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->get(self::$callSid)->feedback->create(array('QualityScore' => 5, 'Issue' => array('post-dial-delay', 'another-issue'))); - $this->assertEquals(5, $feedback->quality_score); - $this->assertEquals(2, count($feedback->issues)); - } - - function testCreateFeedbackShortcut() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json', self::$formHeaders, - 'QualityScore=5&Issue=post-dial-delay&Issue=another-issue') - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array('quality_score' => 5, 'issues' => array('post-dial-delay', 'another-issue'))) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->createFeedback(self::$callSid, 5, array('post-dial-delay', 'another-issue')); - $this->assertEquals(5, $feedback->quality_score); - $this->assertEquals(2, count($feedback->issues)); - } - - function testDeleteFeedback() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '')); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->get(self::$callSid)->feedback->delete(); - $this->assertNull($feedback); - } - - function testDeleteFeedbackShortcut() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '')); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->deleteFeedback(self::$callSid); - $this->assertNull($feedback); - } - - function testGetFeedback() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('quality_score' => 5, 'issues' => array('post-dial-delay', 'another-issue'))) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->get(self::$callSid)->feedback->get(); - $this->assertEquals(5, $feedback->quality_score); - $this->assertNotEmpty($feedback->issues); - } - - function testGetFeedbackShortcut() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/' . self::$accountSid . '/Calls/' . self::$callSid . '/Feedback.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('quality_score' => 5, 'issues' => array('post-dial-delay', 'another-issue'))) - )); - $client = new Services_Twilio(self::$accountSid, self::$authToken, '2010-04-01', $http); - $feedback = $client->account->calls->getFeedback(self::$callSid); - $this->assertEquals(5, $feedback->quality_score); - $this->assertNotEmpty($feedback->issues); - } - - function tearDown() - { - m::close(); - } - -} diff --git a/vendor/twilio-php-master/tests/resources/IncomingPhoneNumbersTest.php b/vendor/twilio-php-master/tests/resources/IncomingPhoneNumbersTest.php deleted file mode 100644 index 3d3ebb4..0000000 --- a/vendor/twilio-php-master/tests/resources/IncomingPhoneNumbersTest.php +++ /dev/null @@ -1,104 +0,0 @@ - array( - array( - 'sid' => 'PN123', - 'sms_fallback_method' => 'POST', - 'voice_method' => 'POST', - 'friendly_name' => '(510) 564-7903', - ) - ), - ); - - function testGetNumberWithResult() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers.json?Page=0&PageSize=1&PhoneNumber=%2B14105551234') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($this->apiResponse) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $number = $client->account->incoming_phone_numbers->getNumber('+14105551234'); - $this->assertEquals('PN123', $number->sid); - } - - function testGetNumberNoResults() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers.json?Page=0&PageSize=1&PhoneNumber=%2B14105551234') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'incoming_phone_numbers' => array(), - 'page' => 0, - 'page_size' => 1, - )) - ) - ); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $number = $client->account->incoming_phone_numbers->getNumber('+14105551234'); - $this->assertNull($number); - } - - function testGetMobile() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($this->apiResponse) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/Mobile.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - foreach ($client->account->incoming_phone_numbers->mobile as $num) { - $this->assertEquals('(510) 564-7903', $num->friendly_name); - } - } - - function testGetLocal() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/Local.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($this->apiResponse) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/Local.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - - foreach ($client->account->incoming_phone_numbers->local as $num) { - $this->assertEquals('(510) 564-7903', $num->friendly_name); - } - } - - function testGetTollFree() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/TollFree.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($this->apiResponse) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/IncomingPhoneNumbers/TollFree.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - foreach ($client->account->incoming_phone_numbers->toll_free as $num) { - $this->assertEquals('(510) 564-7903', $num->friendly_name); - } - } - -} - diff --git a/vendor/twilio-php-master/tests/resources/KeysTest.php b/vendor/twilio-php-master/tests/resources/KeysTest.php deleted file mode 100644 index f91f29c..0000000 --- a/vendor/twilio-php-master/tests/resources/KeysTest.php +++ /dev/null @@ -1,54 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testDelete() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/AC123/Keys/SK123.json') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->keys->delete('SK123'); - } - - function testGet() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Keys/SK123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SK123', 'friendly_name' => 'foo')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $key = $client->account->keys->get('SK123'); - $this->assertNotNull($key); - $this->assertEquals('foo', $key->friendly_name); - } - - function testPost() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Keys.json', - $this->formHeaders, 'FriendlyName=foo') - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SK123', 'secret' => 'SomeSecret')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $key = $client->account->keys->create(array('FriendlyName' => 'foo')); - $this->assertEquals('SK123', $key->sid); - $this->assertEquals('SomeSecret', $key->secret); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/MediaTest.php b/vendor/twilio-php-master/tests/resources/MediaTest.php deleted file mode 100644 index b8edc4f..0000000 --- a/vendor/twilio-php-master/tests/resources/MediaTest.php +++ /dev/null @@ -1,28 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Messages/MM123/Media.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'end' => '0', - 'total' => '2', - 'media_list' => array( - array('sid' => 'ME123'), - array('sid' => 'ME456') - ), - 'next_page_uri' => 'null', - 'start' => 0 - )) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $media_list = $client->account->messages->get('MM123')->media->getPage()->getItems(); - $this->assertEquals(count($media_list), 2); - } - -} diff --git a/vendor/twilio-php-master/tests/resources/MembersTest.php b/vendor/twilio-php-master/tests/resources/MembersTest.php deleted file mode 100644 index 45711ce..0000000 --- a/vendor/twilio-php-master/tests/resources/MembersTest.php +++ /dev/null @@ -1,83 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testFront() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Queues/QQ123/Members/Front.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('call_sid' => 'CA123', 'position' => 0)) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $queue = $client->account->queues->get('QQ123'); - $firstMember = $queue->members->front(); - $this->assertSame($firstMember->call_sid, 'CA123'); - } - - function testDequeueFront() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Queues/QQ123/Members/Front.json', - $this->formHeaders, 'Url=http%3A%2F%2Ffoo.com&Method=POST') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('call_sid' => 'CA123', 'position' => 0)) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $queue = $client->account->queues->get('QQ123'); - $firstMember = $queue->members->front(); - $firstMember->dequeue('http://foo.com'); - } - - function testDequeueSid() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Queues/QQ123/Members/CA123.json', - $this->formHeaders, 'Url=http%3A%2F%2Ffoo.com&Method=GET') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('call_sid' => 'CA123', 'position' => 0)) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $queue = $client->account->queues->get('QQ123'); - $firstMember = $queue->members->get('CA123'); - $firstMember->dequeue('http://foo.com', 'GET'); - } - - function testMemberIterate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $resp = json_encode( - array( - 'queue_members' => array( - array('call_sid' => 'CA123', 'wait_time' => 30) - ), - 'end' => 1, - ) - ); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Queues/QQ123/Members.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), $resp - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Queues/QQ123/Members.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $queue = $client->account->queues->get('QQ123'); - foreach($queue->members as $member) { - $this->assertSame($member->call_sid, 'CA123'); - $this->assertSame($member->wait_time, 30); - } - } - - function tearDown() { - m::close(); - } - -} - - diff --git a/vendor/twilio-php-master/tests/resources/MessagesTest.php b/vendor/twilio-php-master/tests/resources/MessagesTest.php deleted file mode 100644 index c697a52..0000000 --- a/vendor/twilio-php-master/tests/resources/MessagesTest.php +++ /dev/null @@ -1,123 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreateMessage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&Body=Hi+there') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->sendMessage('+1222', '+44123', 'Hi there'); - $this->assertSame('SM123', $msg->sid); - } - - function testCreateMessageWithMedia() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&MediaUrl=http%3A%2F%2Fexample.com%2Fimage1') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->sendMessage('+1222', '+44123', null, - array('http://example.com/image1')); - $this->assertSame('SM123', $msg->sid); - } - - function testCreateMessageWithMediaAndBody() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&MediaUrl=http%3A%2F%2Fexample.com%2Fimage1&Body=Hi+there') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->sendMessage('+1222', '+44123', 'Hi there', - array('http://example.com/image1') - ); - $this->assertSame('SM123', $msg->sid); - } - - function testCreateMessageWithMultipleMedia() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&MediaUrl=http%3A%2F%2Fexample.com%2Fimage1&MediaUrl=http%3A%2F%2Fexample.com%2Fimage2') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->sendMessage('+1222', '+44123', null, - array('http://example.com/image1', 'http://example.com/image2')); - $this->assertSame('SM123', $msg->sid); - } - - function testBadMessageThrowsException() { - $this->setExpectedException('Services_Twilio_RestException'); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&Body=' . str_repeat('hi', 801)) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - json_encode(array( - 'status' => '400', - 'message' => 'Too long', - )) - )); - $client = new Services_Twilio('AC123', '123', null, $http); - $msg = $client->account->messages->sendMessage('+1222', '+44123', str_repeat('hi', 801)); - } - - function testRawCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&MediaUrl=http%3A%2F%2Fexample.com%2Fimage1&MediaUrl=http%3A%2F%2Fexample.com%2Fimage2') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->create(array( - 'From' => '+1222', - 'To' => '+44123', - 'MediaUrl' => array('http://example.com/image1', 'http://example.com/image2') - )); - $this->assertSame('SM123', $msg->sid); - } - - function testDeleteMessage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/AC123/Messages/ME123.json') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $client = new Services_Twilio('AC123', '123', null, $http); - $client->account->messages->delete('ME123'); - } - - function testNewline() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Messages.json', $this->formHeaders, - 'Body=Hello%0A%0AHello') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $msg = $client->account->messages->create(array( - 'Body' => "Hello\n\nHello" - )); - $this->assertSame('SM123', $msg->sid); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/NotificationTest.php b/vendor/twilio-php-master/tests/resources/NotificationTest.php deleted file mode 100644 index 704230e..0000000 --- a/vendor/twilio-php-master/tests/resources/NotificationTest.php +++ /dev/null @@ -1,20 +0,0 @@ -shouldReceive('delete')->once() - ->with('/2010-04-01/Accounts/AC123/Notifications/NO123.json') - ->andReturn(array(204, array(), '')); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->notifications->delete('NO123'); - } - - function tearDown() - { - m::close(); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/OutgoingCallerIdsTest.php b/vendor/twilio-php-master/tests/resources/OutgoingCallerIdsTest.php deleted file mode 100644 index 65d1ecd..0000000 --- a/vendor/twilio-php-master/tests/resources/OutgoingCallerIdsTest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'application/x-www-form-urlencoded'); - function testPost() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/OutgoingCallerIds.json', - $this->formHeaders, 'PhoneNumber=%2B14158675309&FriendlyName=My+Home+Phone+Number') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'account_sid' => 'AC123', - 'phone_number' => '+14158675309', - 'friendly_name' => 'My Home Phone Number', - 'validation_code' => 123456, - )) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $request = $client->account->outgoing_caller_ids->create('+14158675309', array( - 'FriendlyName' => 'My Home Phone Number', - )); - $this->assertEquals(123456, $request->validation_code); - } - - function tearDown() { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/QueuesTest.php b/vendor/twilio-php-master/tests/resources/QueuesTest.php deleted file mode 100644 index 282a142..0000000 --- a/vendor/twilio-php-master/tests/resources/QueuesTest.php +++ /dev/null @@ -1,28 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Queues.json', $this->formHeaders, - 'FriendlyName=foo&MaxSize=123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'QQ123', 'average_wait_time' => 0)) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $queue = $client->account->queues->create('foo', - array('MaxSize' => 123)); - $this->assertSame($queue->sid, 'QQ123'); - $this->assertSame($queue->average_wait_time, 0); - } - - function tearDown() { - m::close(); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/SMSMessagesTest.php b/vendor/twilio-php-master/tests/resources/SMSMessagesTest.php deleted file mode 100644 index afe5b6c..0000000 --- a/vendor/twilio-php-master/tests/resources/SMSMessagesTest.php +++ /dev/null @@ -1,38 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreateMessage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&Body=Hi+there') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SM123')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $sms = $client->account->sms_messages->create('+1222', '+44123', 'Hi there'); - $this->assertSame('SM123', $sms->sid); - } - - function testBadMessageThrowsException() { - $this->setExpectedException('Services_Twilio_RestException'); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/Messages.json', $this->formHeaders, - 'From=%2B1222&To=%2B44123&Body=' . str_repeat('hi', 81)) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - json_encode(array( - 'status' => '400', - 'message' => 'Too long', - )) - )); - $client = new Services_Twilio('AC123', '123', null, $http); - $sms = $client->account->sms_messages->create('+1222', '+44123', - str_repeat('hi', 81)); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/SandboxTest.php b/vendor/twilio-php-master/tests/resources/SandboxTest.php deleted file mode 100644 index 4d6623f..0000000 --- a/vendor/twilio-php-master/tests/resources/SandboxTest.php +++ /dev/null @@ -1,23 +0,0 @@ - 'application/x-www-form-urlencoded'); - function testUpdateVoiceUrl() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Sandbox.json', $this->formHeaders, 'VoiceUrl=foo') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('voice_url' => 'foo')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $client->account->sandbox->update('VoiceUrl', 'foo'); - $this->assertEquals('foo', $client->account->sandbox->voice_url); - } - - function tearDown() { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/ShortCodesTest.php b/vendor/twilio-php-master/tests/resources/ShortCodesTest.php deleted file mode 100644 index aee9e40..0000000 --- a/vendor/twilio-php-master/tests/resources/ShortCodesTest.php +++ /dev/null @@ -1,19 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/SMS/ShortCodes/SC123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'SC123', 'short_code' => '1234')) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $sms = $client->account->short_codes->get('SC123'); - $this->assertSame('1234', $sms->short_code); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/TokensTest.php b/vendor/twilio-php-master/tests/resources/TokensTest.php deleted file mode 100644 index 00b5bdf..0000000 --- a/vendor/twilio-php-master/tests/resources/TokensTest.php +++ /dev/null @@ -1,29 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testCreateToken() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Tokens.json', $this->formHeaders, '') - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array( - 'username' => 'user', - 'password' => 'pass', - 'ttl' => 86400, - 'account_sid' => 'AC123', - 'ice_servers' => array('example.com'), - 'date_created' => 'yesterday', - 'date_updated' => 'right now') - ) - )); - $client = new Services_Twilio('AC123', '123', '2010-04-01', $http); - $token = $client->account->tokens->create(); - $this->assertSame('user', $token->username); - - } -} diff --git a/vendor/twilio-php-master/tests/resources/UsageRecordsTest.php b/vendor/twilio-php-master/tests/resources/UsageRecordsTest.php deleted file mode 100644 index 5f0f27b..0000000 --- a/vendor/twilio-php-master/tests/resources/UsageRecordsTest.php +++ /dev/null @@ -1,180 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'sms', - 'count' => 5, - 'end_date' => '2012-08-01', - ), - array( - 'category' => 'calleridlookups', - 'count' => 5, - 'end_date' => '2012-08-01', - )) - )) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - foreach ($client->account->usage_records as $record) { - $this->assertSame(5, $record->count); - } - } - - function testUsageRecordSubresource() { - - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records/LastMonth.json?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'sms', - 'count' => 4, - 'end_date' => '2012-08-01', - ), - array( - 'category' => 'calleridlookups', - 'count' => 4, - 'end_date' => '2012-08-01', - )) - )) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records/LastMonth.json?Page=1&PageSize=50') - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - foreach ($client->account->usage_records->last_month as $record) { - $this->assertSame('2012-08-01', $record->end_date); - } - } - - function testGetCategory() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records.json?Page=0&PageSize=1&Category=calls') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'calls', - 'count' => 4, - 'price' => '100.30', - 'end_date' => '2012-08-01', - )), - )) - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - $callRecord = $client->account->usage_records->getCategory('calls'); - $this->assertSame('100.30', $callRecord->price); - } - - function testFilterUsageRecords() { - $http = m::mock(new Services_Twilio_TinyHttp); - $params = 'Page=0&PageSize=50&StartDate=2012-08-01&EndDate=2012-08-31'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records.json?' . $params) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'sms', - 'count' => 4, - 'price' => '300.30', - ), - array( - 'category' => 'calls', - 'count' => 4, - 'price' => '100.30', - )), - )) - )); - $params = 'Page=1&PageSize=50&StartDate=2012-08-01&EndDate=2012-08-31'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records.json?' . $params) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - foreach ($client->account->usage_records->getIterator(0, 50, array( - 'StartDate' => '2012-08-01', - 'EndDate' => '2012-08-31', - )) as $record) { - $this->assertSame(4, $record->count); - } - } - - function testGetCategoryOnSubresource() { - $http = m::mock(new Services_Twilio_TinyHttp); - $params = 'Page=0&PageSize=1&Category=sms'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records/Today.json?' . $params) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'sms', - 'count' => 4, - 'price' => '100.30', - 'end_date' => '2012-08-30' - )), - )) - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - $smsRecord = $client->account->usage_records->today->getCategory('sms'); - $this->assertSame($smsRecord->end_date, '2012-08-30'); - } - - function testTimeSeriesFilters() { - $http = m::mock(new Services_Twilio_TinyHttp); - $params = 'Page=0&PageSize=50&StartDate=2012-08-01&EndDate=2012-08-31&Category=recordings'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records/Daily.json?' . $params) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_records' => array( - array( - 'category' => 'recordings', - 'count' => 4, - 'price' => '100.30', - 'end_date' => '2012-08-31' - ), - array( - 'category' => 'recordings', - 'count' => 4, - 'price' => '100.30', - 'end_date' => '2012-08-30' - )), - )) - )); - $params = 'Page=1&PageSize=50&StartDate=2012-08-01&EndDate=2012-08-31&Category=recordings'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Records/Daily.json?' . $params) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - foreach ($client->account->usage_records->daily->getIterator(0, 50, array( - 'StartDate' => '2012-08-01', - 'EndDate' => '2012-08-31', - 'Category' => 'recordings', - )) as $record) { - $this->assertSame($record->category, 'recordings'); - $this->assertSame($record->price, '100.30'); - } - } -} - diff --git a/vendor/twilio-php-master/tests/resources/UsageTriggersTest.php b/vendor/twilio-php-master/tests/resources/UsageTriggersTest.php deleted file mode 100644 index 96d49cc..0000000 --- a/vendor/twilio-php-master/tests/resources/UsageTriggersTest.php +++ /dev/null @@ -1,114 +0,0 @@ -shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers/UT123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'sid' => 'UT123', - 'date_created' => 'Tue, 09 Oct 2012 19:27:24 +0000', - 'recurring' => null, - 'usage_category' => 'totalprice', - )) - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - $usageSid = 'UT123'; - $usageTrigger = $client->account->usage_triggers->get($usageSid); - $this->assertSame('totalprice', $usageTrigger->usage_category); - } - - protected $formHeaders = array('Content-Type' => 'application/x-www-form-urlencoded'); - - function testUpdateTrigger() { - $http = m::mock(new Services_Twilio_TinyHttp); - $usageSid = 'UT123'; - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers/UT123.json', - $this->formHeaders, 'FriendlyName=new') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'friendly_name' => 'new', - 'sid' => 'UT123', - 'uri' => '/2010-04-01/Accounts/AC123/Usage/Triggers/UT123.json' - )) - )); - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers/UT123.json') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'sid' => 'UT123', - 'friendly_name' => 'new', - )) - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - $usageTrigger = $client->account->usage_triggers->get($usageSid); - $usageTrigger->update(array( - 'FriendlyName' => 'new', - )); - $usageTrigger2 = $client->account->usage_triggers->get($usageSid); - $this->assertSame('new', $usageTrigger2->friendly_name); - } - - function testFilterTriggerList() { - $http = m::mock(new Services_Twilio_TinyHttp); - $params = 'Page=0&PageSize=50&UsageCategory=sms'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers.json?' . $params) - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('usage_triggers' => array( - array( - 'usage_category' => 'sms', - 'current_value' => '4', - 'trigger_value' => '100.30', - ), - array( - 'usage_category' => 'sms', - 'current_value' => '4', - 'trigger_value' => '400.30', - )), - 'next_page_uri' => '/2010-04-01/Accounts/AC123/Usage/Triggers.json?UsageCategory=sms&Page=1&PageSize=50', - )) - )); - $params = 'UsageCategory=sms&Page=1&PageSize=50'; - $http->shouldReceive('get')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers.json?' . $params) - ->andReturn(array(400, array('Content-Type' => 'application/json'), - '{"status":400,"message":"foo", "code": "20006"}' - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - foreach ($client->account->usage_triggers->getIterator( - 0, 50, array( - 'UsageCategory' => 'sms', - )) as $trigger - ) { - $this->assertSame($trigger->current_value, "4"); - } - } - - function testCreateTrigger() { - $http = m::mock(new Services_Twilio_TinyHttp); - $params = 'UsageCategory=sms&TriggerValue=100&CallbackUrl=foo'; - $http->shouldReceive('post')->once() - ->with('/2010-04-01/Accounts/AC123/Usage/Triggers.json', - $this->formHeaders, $params) - ->andReturn(array(201, array('Content-Type' => 'application/json'), - json_encode(array( - 'usage_category' => 'sms', - 'sid' => 'UT123', - 'uri' => '/2010-04-01/Accounts/AC123/Usage/Triggers/UT123.json' - )) - )); - $client = new Services_Twilio('AC123', '456bef', '2010-04-01', $http); - $trigger = $client->account->usage_triggers->create( - 'sms', - '100', - 'foo' - ); - $this->assertSame('sms', $trigger->usage_category); - } -} - diff --git a/vendor/twilio-php-master/tests/resources/lookups/PhoneNumbersTest.php b/vendor/twilio-php-master/tests/resources/lookups/PhoneNumbersTest.php deleted file mode 100644 index b4b2fc5..0000000 --- a/vendor/twilio-php-master/tests/resources/lookups/PhoneNumbersTest.php +++ /dev/null @@ -1,80 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/PhoneNumbers/4153902337') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'country_code' => 'US', - 'phone_number' => '4153902337', - 'national_format' => '4153902337', - 'carrier' => array( - 'mobile_country_code' => '123', - 'mobile_network_code' => '123', - 'name' => '123', - 'type' => '123', - 'error_code' => 0 - ) - )) - )); - $client = new Lookups_Services_Twilio('AC123', '123', 'v1', $http); - $number = $client->phone_numbers->get('4153902337'); - $this->assertNotNull($number); - $this->assertEquals('US', $number->country_code); - } - - function testGetPhoneNumberWithCountryCode() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/PhoneNumbers/4153902337?CountryCode=US') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'country_code' => 'US', - 'phone_number' => '4153902337', - 'national_format' => '4153902337', - 'carrier' => array( - 'mobile_country_code' => '123', - 'mobile_network_code' => '123', - 'name' => '123', - 'type' => '123', - 'error_code' => 0 - ) - )) - )); - $client = new Lookups_Services_Twilio('AC123', '123', 'v1', $http); - $number = $client->phone_numbers->get('4153902337', array('CountryCode' => 'US')); - $this->assertNotNull($number); - $this->assertEquals('US', $number->country_code); - } - - function testGetPhoneNumberWithCountryCodeAndType() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/PhoneNumbers/4153902337?CountryCode=US&Type=carrier') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'country_code' => 'US', - 'phone_number' => '4153902337', - 'national_format' => '4153902337', - 'carrier' => array( - 'mobile_country_code' => '123', - 'mobile_network_code' => '123', - 'name' => '123', - 'type' => '123', - 'error_code' => 0 - ) - )) - )); - $client = new Lookups_Services_Twilio('AC123', '123', 'v1', $http); - $number = $client->phone_numbers->get('4153902337', array('CountryCode' => 'US', 'Type' => 'carrier')); - $this->assertNotNull($number); - $this->assertEquals('US', $number->country_code); - } - -} diff --git a/vendor/twilio-php-master/tests/resources/monitor/AlertsTest.php b/vendor/twilio-php-master/tests/resources/monitor/AlertsTest.php deleted file mode 100644 index 3db7563..0000000 --- a/vendor/twilio-php-master/tests/resources/monitor/AlertsTest.php +++ /dev/null @@ -1,42 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Alerts/NO123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'NO123', 'alert_text' => 'Test')) - )); - $monitorClient = new Monitor_Services_Twilio('AC123', '123', 'v1', $http); - $alert = $monitorClient->alerts->get('NO123'); - $this->assertNotNull($alert); - $this->assertEquals('Test', $alert->alert_text); - } - - function testGetList() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Alerts?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'alerts', 'next_page_url' => null), - 'alerts' => array(array('sid' => 'NO123')) - )) - )); - $monitorClient = new Monitor_Services_Twilio('AC123', '123', 'v1', $http); - foreach ($monitorClient->alerts->getIterator(0, 50) as $alert) { - $this->assertEquals('NO123', $alert->sid); - } - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/monitor/EventsTest.php b/vendor/twilio-php-master/tests/resources/monitor/EventsTest.php deleted file mode 100644 index 76b5859..0000000 --- a/vendor/twilio-php-master/tests/resources/monitor/EventsTest.php +++ /dev/null @@ -1,42 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Events/AE123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'AE123', 'description' => 'Test')) - )); - $monitorClient = new Monitor_Services_Twilio('AC123', '123', 'v1', $http); - $event = $monitorClient->events->get('AE123'); - $this->assertNotNull($event); - $this->assertEquals('Test', $event->description); - } - - function testGetList() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Events?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'events', 'next_page_url' => null), - 'events' => array(array('sid' => 'AE123')) - )) - )); - $monitorClient = new Monitor_Services_Twilio('AC123', '123', 'v1', $http); - foreach ($monitorClient->events->getIterator(0, 50) as $event) { - $this->assertEquals('AE123', $event->sid); - } - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/pricing/MessagingTest.php b/vendor/twilio-php-master/tests/resources/pricing/MessagingTest.php deleted file mode 100644 index 2851833..0000000 --- a/vendor/twilio-php-master/tests/resources/pricing/MessagingTest.php +++ /dev/null @@ -1,47 +0,0 @@ - array( - 'key' => 'countries', - 'next_page_url' => null - ), - 'countries' => array( - array('iso_country' => 'US') - ) - ); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with( - '/v1/Messaging/Countries?Page=0&PageSize=50' - )->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($data))); - - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', - $http, 1); - $countries = $pricingClient->messagingCountries->getPage(); - $this->assertNotNull($countries); - - $countryList = $countries->getItems(); - $country = $countryList[0]; - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'US'); - } - - function testGetCountry() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with('/v1/Messaging/Countries/EE') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('country' => 'Estonia')))); - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', $http, 1); - - $country = $pricingClient->messagingCountries->get('EE'); - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'EE'); - $this->assertEquals($country->country, 'Estonia'); - } -} diff --git a/vendor/twilio-php-master/tests/resources/pricing/PhoneNumbersTest.php b/vendor/twilio-php-master/tests/resources/pricing/PhoneNumbersTest.php deleted file mode 100644 index ee09414..0000000 --- a/vendor/twilio-php-master/tests/resources/pricing/PhoneNumbersTest.php +++ /dev/null @@ -1,47 +0,0 @@ - array( - 'key' => 'countries', - 'next_page_url' => null - ), - 'countries' => array( - array('iso_country' => 'US') - ) - ); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with( - '/v1/PhoneNumbers/Countries?Page=0&PageSize=50' - )->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($data))); - - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', - $http, 1); - $countries = $pricingClient->phoneNumberCountries->getPage(); - $this->assertNotNull($countries); - - $countryList = $countries->getItems(); - $country = $countryList[0]; - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'US'); - } - - function testGetCountry() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with('/v1/PhoneNumbers/Countries/EE') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('country' => 'Estonia')))); - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', $http, 1); - - $country = $pricingClient->phoneNumberCountries->get('EE'); - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'EE'); - $this->assertEquals($country->country, 'Estonia'); - } -} diff --git a/vendor/twilio-php-master/tests/resources/pricing/VoiceTest.php b/vendor/twilio-php-master/tests/resources/pricing/VoiceTest.php deleted file mode 100644 index eb283aa..0000000 --- a/vendor/twilio-php-master/tests/resources/pricing/VoiceTest.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'key' => 'countries', - 'next_page_url' => null - ), - 'countries' => array( - array('iso_country' => 'US') - ) - ); - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with( - '/v1/Voice/Countries?Page=0&PageSize=50' - )->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode($data))); - - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', - $http, 1); - $countries = $pricingClient->voiceCountries->getPage(); - $this->assertNotNull($countries); - - $countryList = $countries->getItems(); - $country = $countryList[0]; - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'US'); - } - - function testGetCountry() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with('/v1/Voice/Countries/EE') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('country' => 'Estonia')))); - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', $http, 1); - - $country = $pricingClient->voiceCountries->get('EE'); - $this->assertNotNull($country); - $this->assertEquals($country->iso_country, 'EE'); - $this->assertEquals($country->country, 'Estonia'); - } - - function testGetNumber() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once()->with( - '/v1/Voice/Numbers/+14155551234' - )->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('iso_country' => 'US')))); - - $pricingClient = new Pricing_Services_Twilio('AC123', '123', 'v1', $http, 1); - - $number = $pricingClient->voiceNumbers->get('+14155551234'); - $this->assertNotNull($number); - $this->assertEquals($number->number, '+14155551234'); - $this->assertEquals($number->iso_country, 'US'); - } - -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/ActivitiesTest.php b/vendor/twilio-php-master/tests/resources/task_router/ActivitiesTest.php deleted file mode 100644 index 89d0aee..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/ActivitiesTest.php +++ /dev/null @@ -1,56 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces/WS123/Activities', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Activity&Available=1') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WA123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $activity = $taskrouterClient->workspace->activities->create('Test Activity', true); - $this->assertNotNull($activity); - } - - function testGet() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Activities/WA123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WA123', 'friendly_name' => 'Test Activity')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $activity = $taskrouterClient->workspace->activities->get('WA123'); - $this->assertNotNull($activity); - $this->assertEquals('Test Activity', $activity->friendly_name); - } - - function testGetPage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Activities?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'activities', 'next_page_url' => null), - 'activities' => array(array('sid' => 'WA123', 'friendly_name' => 'Test Activity')) - )))); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $activities = $taskrouterClient->workspace->activities->getPage(); - $activityItems = $activities->getItems(); - $this->assertNotNull($activities); - $this->assertEquals('Test Activity', $activityItems[0]->friendly_name); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/EventsTest.php b/vendor/twilio-php-master/tests/resources/task_router/EventsTest.php deleted file mode 100644 index 6113d99..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/EventsTest.php +++ /dev/null @@ -1,42 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Events/EV123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'EV123', 'description' => 'Test Worker')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $worker = $taskrouterClient->workspace->events->get('EV123'); - $this->assertNotNull($worker); - $this->assertEquals('Test Worker', $worker->description); - } - - function testGetList() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Events?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'events', 'next_page_url' => null), - 'events' => array(array('sid' => 'EV123')) - )) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - foreach ($taskrouterClient->workspace->events->getIterator(0, 50) as $event) { - $this->assertEquals('EV123', $event->sid); - } - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/ReservationsTest.php b/vendor/twilio-php-master/tests/resources/task_router/ReservationsTest.php deleted file mode 100644 index ee9dece..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/ReservationsTest.php +++ /dev/null @@ -1,56 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Tasks/WT123/Reservations/WR123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WR123', 'reservation_status' => 'reserved')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $reservation = $taskrouterClient->workspace->tasks->get('WT123')->reservations->get('WR123'); - $this->assertNotNull($reservation); - $this->assertEquals('reserved', $reservation->reservation_status); - } - - function testGetPage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Tasks/WT123/Reservations?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'reservations', 'next_page_url' => null), - 'reservations' => array(array('sid' => 'WR123', 'reservation_status' => 'reserved')) - )))); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $reservations = $taskrouterClient->workspace->tasks->get('WT123')->reservations->getPage(); - $reservationItems = $reservations->getItems(); - $this->assertNotNull($reservations); - $this->assertEquals('reserved', $reservationItems[0]->reservation_status); - } - - function testGetWorkerReservations() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/WK123/Reservations?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'reservations', 'next_page_url' => null), - 'reservations' => array(array('sid' => 'WR123', 'reservation_status' => 'reserved')) - )))); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $reservations = $taskrouterClient->workspace->workers->get('WK123')->reservations->getPage(); - $reservationItems = $reservations->getItems(); - $this->assertNotNull($reservations); - $this->assertEquals('reserved', $reservationItems[0]->reservation_status); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/TaskQueueStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/TaskQueueStatisticsTest.php deleted file mode 100644 index f2cec3e..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/TaskQueueStatisticsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/TaskQueues/WQ123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getTaskQueueStatistics('WQ123', array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaTaskQueue() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/TaskQueues/WQ123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->task_queues->get("WQ123")->statistics->get(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesStatisticsTest.php deleted file mode 100644 index a045423..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesStatisticsTest.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/TaskQueues/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getTaskQueuesStatistics(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaTaskQueues() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/TaskQueues/Statistics?Page=0&PageSize=50&Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'task_queues_statistics', 'next_page_url' => null), - 'task_queues_statistics' => array(array('task_queue_sid' => 'WQ123')) - )) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->task_queues->statistics->getPage(0, 50, array('Minutes' => 60)); - $this->assertNotNull($stats); - foreach ($stats->getItems() as $stat) { - $this->assertEquals('WQ123', $stat->task_queue_sid); - } - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesTest.php b/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesTest.php deleted file mode 100644 index bca0b47..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/TaskQueuesTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces/WS123/TaskQueues', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Queue&AssignmentActivitySid=WA123&ReservationActivitySid=WR123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WQ123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $queue = $taskrouterClient->workspace->task_queues->create('Test Queue', 'WA123', 'WR123'); - $this->assertNotNull($queue); - } - - function testGet() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/TaskQueues/WQ123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WQ123', 'friendly_name' => 'Test Queue')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $queue = $taskrouterClient->workspace->task_queues->get('WQ123'); - $this->assertNotNull($queue); - $this->assertEquals('Test Queue', $queue->friendly_name); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/TasksTest.php b/vendor/twilio-php-master/tests/resources/task_router/TasksTest.php deleted file mode 100644 index 350a998..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/TasksTest.php +++ /dev/null @@ -1,57 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces/WS123/Tasks', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'Timeout=60&Attributes=attribute&WorkflowSid=WF123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WT123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $activity = $taskrouterClient->workspace->tasks->create('attribute', 'WF123',array( - 'Timeout' => 60, - )); - $this->assertNotNull($activity); - } - - function testGet() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Tasks/WT123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WT123', 'workflow_sid' => 'WF123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $task = $taskrouterClient->workspace->tasks->get('WT123'); - $this->assertNotNull($task); - $this->assertEquals('WF123', $task->workflow_sid); - } - - function testGetPage() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Tasks?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'tasks', 'next_page_url' => null), - 'tasks' => array(array('sid' => 'WT123', 'workflow_sid' => 'WF123')) - )))); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $tasks = $taskrouterClient->workspace->tasks->getPage(); - $tasksItems = $tasks->getItems(); - $this->assertNotNull($tasks); - $this->assertEquals('WF123', $tasksItems[0]->workflow_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkerStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkerStatisticsTest.php deleted file mode 100644 index 4346c13..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkerStatisticsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/WK123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getWorkerStatistics('WK123', array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaWorker() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/WK123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->workers->get("WK123")->statistics->get(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkersStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkersStatisticsTest.php deleted file mode 100644 index f7c0a72..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkersStatisticsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getWorkersStatistics(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaWorkers() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->workers->statistics->get(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkersTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkersTest.php deleted file mode 100644 index d3f5f6c..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkersTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces/WS123/Workers', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Worker') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WK123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $worker = $taskrouterClient->workspace->workers->create('Test Worker'); - $this->assertNotNull($worker); - } - - function testGet() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workers/WK123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WQ123', 'friendly_name' => 'Test Worker')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $worker = $taskrouterClient->workspace->workers->get('WK123'); - $this->assertNotNull($worker); - $this->assertEquals('Test Worker', $worker->friendly_name); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkflowStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkflowStatisticsTest.php deleted file mode 100644 index 48caa1e..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkflowStatisticsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workflows/WF123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getWorkflowStatistics('WF123', array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaWorkflow() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workflows/WF123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->workflows->get("WF123")->statistics->get(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkflowsTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkflowsTest.php deleted file mode 100644 index a9c0c58..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkflowsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces/WS123/Workflows', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Workflow&Configuration=configuration&AssignmentCallbackUrl=http%3A%2F%2Fwww.example.com') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WF123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $workflow = $taskrouterClient->workspace->workflows->create('Test Workflow', 'configuration', 'http://www.example.com'); - $this->assertNotNull($workflow); - } - - function testGet() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Workflows/WF123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WF123', 'friendly_name' => 'Test Workflow')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $workflow = $taskrouterClient->workspace->workflows->get('WF123'); - $this->assertNotNull($workflow); - $this->assertEquals('Test Workflow', $workflow->friendly_name); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkspaceStatisticsTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkspaceStatisticsTest.php deleted file mode 100644 index 35eda31..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkspaceStatisticsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->getWorkspaceStatistics(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function testGetViaWorkspace() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces/WS123/Statistics?Minutes=60') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('account_sid' => 'AC123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $stats = $taskrouterClient->workspace->statistics->get(array('Minutes' => 60)); - $this->assertNotNull($stats); - $this->assertEquals('AC123', $stats->account_sid); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/task_router/WorkspacesTest.php b/vendor/twilio-php-master/tests/resources/task_router/WorkspacesTest.php deleted file mode 100644 index 083e260..0000000 --- a/vendor/twilio-php-master/tests/resources/task_router/WorkspacesTest.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldReceive('post')->once() - ->with('/v1/Workspaces', - array('Content-Type' => 'application/x-www-form-urlencoded'), - 'FriendlyName=Test+Workspace') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'WS123')) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $workspace = $taskrouterClient->workspaces->create('Test Workspace'); - $this->assertNotNull($workspace); - } - - function testGetList() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Workspaces?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'workspaces', 'next_page_url' => null), - 'workspaces' => array(array('sid' => 'WS123')) - )) - )); - $taskrouterClient = new TaskRouter_Services_Twilio('AC123', '123', 'WS123', 'v1', $http); - $this->assertNotNull($taskrouterClient->workspaces); - foreach ($taskrouterClient->workspaces->getIterator(0, 50) as $workspace) { - $this->assertEquals('WS123', $workspace->sid); - } - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/trunking/CredentialListsTest.php b/vendor/twilio-php-master/tests/resources/trunking/CredentialListsTest.php deleted file mode 100644 index 483a92c..0000000 --- a/vendor/twilio-php-master/tests/resources/trunking/CredentialListsTest.php +++ /dev/null @@ -1,72 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testRead() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/CredentialLists?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'credential_lists', 'next_page_url' => null), - 'credential_lists' => array(array('sid' => 'CL123')) - )) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - foreach ($trunk->credential_lists->getIterator(0, 50) as $credential_list) { - $this->assertEquals('CL123', $credential_list->sid); - } - } - - function testFetch() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/CredentialLists/CL123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'CL123', 'friendly_name' => 'CredentialList')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $credential_list = $trunk->credential_lists->get('CL123'); - $this->assertNotNull($credential_list); - $this->assertEquals('CredentialList', $credential_list->friendly_name); - } - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123/CredentialLists', $this->formHeaders, - 'CredentialListSid=CL123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'CL123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $credential_list = $trunk->credential_lists->create(array( - 'CredentialListSid' => 'CL123' - )); - $this->assertSame('CL123', $credential_list->sid); - } - - function testDelete() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/v1/Trunks/TK123/CredentialLists/CL123') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', null, $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $trunk->credential_lists->delete('CL123'); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/trunking/IpAccessControlLists.php b/vendor/twilio-php-master/tests/resources/trunking/IpAccessControlLists.php deleted file mode 100644 index ba2552d..0000000 --- a/vendor/twilio-php-master/tests/resources/trunking/IpAccessControlLists.php +++ /dev/null @@ -1,72 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testRead() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/IpAccessControlLists?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'ip_access_control_lists', 'next_page_url' => null), - 'ip_access_control_lists' => array(array('sid' => 'AL123')) - )) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - foreach ($trunk->ip_access_control_lists->getIterator(0, 50) as $ip_access_control_list) { - $this->assertEquals('AL123', $ip_access_control_list->sid); - } - } - - function testFetch() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/IpAccessControlLists/AL123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'AL123', 'friendly_name' => 'IpAccessControlList')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $ip_access_control_list = $trunk->ip_access_control_lists->get('AL123'); - $this->assertNotNull($ip_access_control_list); - $this->assertEquals('IpAccessControlList', $ip_access_control_list->friendly_name); - } - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123/IpAccessControlLists', $this->formHeaders, - 'IpAccessControlListSid=AL123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'AL123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $ip_access_control_list = $trunk->ip_access_control_lists->create(array( - 'IpAccessControlListSid' => 'AL123' - )); - $this->assertSame('AL123', $ip_access_control_list->sid); - } - - function testDelete() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/v1/Trunks/TK123/IpAccessControlLists/AL123') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', null, $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $trunk->ip_access_control_lists->delete('AL123'); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/trunking/OriginationUrls.php b/vendor/twilio-php-master/tests/resources/trunking/OriginationUrls.php deleted file mode 100644 index d5bba88..0000000 --- a/vendor/twilio-php-master/tests/resources/trunking/OriginationUrls.php +++ /dev/null @@ -1,90 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testRead() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/OriginationUrls?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'origination_urls', 'next_page_url' => null), - 'origination_urls' => array(array('sid' => 'OU123')) - )) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - foreach ($trunk->origination_urls->getIterator(0, 50) as $origination_url) { - $this->assertEquals('OU123', $origination_url->sid); - } - } - - function testFetch() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/OriginationUrls/OU123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'OU123', 'friendly_name' => 'OriginationUrl')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $origination_url = $trunk->origination_urls->get('OU123'); - $this->assertNotNull($origination_url); - $this->assertEquals('OriginationUrl', $origination_url->friendly_name); - } - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123/OriginationUrls', $this->formHeaders, - 'FriendlyName=TestUrl') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'OU123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $origination_url = $trunk->origination_urls->create(array( - 'FriendlyName' => 'TestUrl' - )); - $this->assertSame('OU123', $origination_url->sid); - } - - function testUpdate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123/OriginationUrls/OU123', $this->formHeaders, - 'FriendlyName=TestUrl&SipUrl=http://sip.com') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'OU123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $origination_url = $trunk->origination_urls->get('OU123'); - $origination_url->update(array( - 'FriendlyName' => 'TestUrl', - 'SipUrl' => 'http://sip.com' - )); - $this->assertSame('OU123', $orignation_url->sid); - } - - function testDelete() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/v1/Trunks/TK123/OriginationUrls/OU123') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', null, $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $trunk->origination_urls->delete('OU123'); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/trunking/PhoneNumbers.php b/vendor/twilio-php-master/tests/resources/trunking/PhoneNumbers.php deleted file mode 100644 index 303f3d8..0000000 --- a/vendor/twilio-php-master/tests/resources/trunking/PhoneNumbers.php +++ /dev/null @@ -1,72 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testRead() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/PhoneNumbers?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'phone_numbers', 'next_page_url' => null), - 'phone_numbers' => array(array('sid' => 'PN123')) - )) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - foreach ($trunk->phone_numbers->getIterator(0, 50) as $phone_number) { - $this->assertEquals('PN123', $phone_number->sid); - } - } - - function testFetch() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123/PhoneNumbers/PN123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'PN123', 'friendly_name' => 'PhoneNumber')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $phone_number = $trunk->phone_numbers->get('PN123'); - $this->assertNotNull($phone_number); - $this->assertEquals('PhoneNumber', $phone_number->friendly_name); - } - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123/PhoneNumbers', $this->formHeaders, - 'PhoneNumberSid=PN123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'PN123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $phone_number = $trunk->phone_numbers->create(array( - 'PhoneNumberSid' => 'PN123' - )); - $this->assertSame('PN123', $phone_number->sid); - } - - function testDelete() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/v1/Trunks/TK123/PhoneNumbers/PN123') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', null, $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $trunk->phone_numbers->delete('PN123'); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio-php-master/tests/resources/trunking/TrunksTest.php b/vendor/twilio-php-master/tests/resources/trunking/TrunksTest.php deleted file mode 100644 index 1326764..0000000 --- a/vendor/twilio-php-master/tests/resources/trunking/TrunksTest.php +++ /dev/null @@ -1,86 +0,0 @@ - 'application/x-www-form-urlencoded'); - - function testRead() - { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks?Page=0&PageSize=50') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array( - 'meta' => array('key' => 'trunks', 'next_page_url' => null), - 'trunks' => array(array('sid' => 'TK123')) - )) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - foreach ($trunkingClient->trunks->getIterator(0, 50) as $trunk) { - $this->assertEquals('TK123', $trunk->sid); - } - } - - function testFetch() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('get')->once() - ->with('/v1/Trunks/TK123') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'TK123', 'friendly_name' => 'TestTrunk')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', 'v1', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $this->assertNotNull($trunk); - $this->assertEquals('TestTrunk', $trunk->friendly_name); - } - - function testCreate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks', $this->formHeaders, - 'FriendlyName=TestTrunk&DomainName=test.pstn.twilio.com') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'TK123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->create(array( - 'FriendlyName' => 'TestTrunk', - 'DomainName' => 'test.pstn.twilio.com' - )); - $this->assertSame('TK123', $trunk->sid); - } - - function testUpdate() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('post')->once() - ->with('/v1/Trunks/TK123', $this->formHeaders, - 'FriendlyName=TestTrunk&DomainName=test.pstn.twilio.com') - ->andReturn(array(200, array('Content-Type' => 'application/json'), - json_encode(array('sid' => 'TK123')) - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', '2010-04-01', $http); - $trunk = $trunkingClient->trunks->get('TK123'); - $trunk->update(array( - 'FriendlyName' => 'TestTrunk', - 'DomainName' => 'test.pstn.twilio.com' - )); - $this->assertSame('TK123', $trunk->sid); - } - - function testDelete() { - $http = m::mock(new Services_Twilio_TinyHttp); - $http->shouldReceive('delete')->once() - ->with('/v1/Trunks/TK123') - ->andReturn(array(204, array('Content-Type' => 'application/json'), '' - )); - $trunkingClient = new Trunking_Services_Twilio('AC123', '123', null, $http); - $trunkingClient->trunks->delete('TK123'); - } - - function tearDown() - { - m::close(); - } -} diff --git a/vendor/twilio/sdk/.github/ISSUE_TEMPLATE/config.yml b/vendor/twilio/sdk/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f829770 --- /dev/null +++ b/vendor/twilio/sdk/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +contact_links: + - name: Twilio Support + url: https://twilio.com/help/contact + about: Get Support + - name: Stack Overflow + url: https://stackoverflow.com/questions/tagged/twilio-php+or+twilio+php + about: Ask questions on Stack Overflow + - name: Documentation + url: https://www.twilio.com/docs/libraries/reference/twilio-php + about: View Reference Documentation diff --git a/vendor/twilio/sdk/.github/workflows/pr-lint.yml b/vendor/twilio/sdk/.github/workflows/pr-lint.yml new file mode 100644 index 0000000..3152007 --- /dev/null +++ b/vendor/twilio/sdk/.github/workflows/pr-lint.yml @@ -0,0 +1,21 @@ +name: Lint PR +on: + pull_request_target: + types: [ opened, edited, synchronize, reopened ] + +jobs: + validate: + name: Validate title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + with: + types: | + chore + docs + fix + feat + misc + test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/vendor/twilio/sdk/.github/workflows/test-and-deploy.yml b/vendor/twilio/sdk/.github/workflows/test-and-deploy.yml new file mode 100644 index 0000000..fc94bb5 --- /dev/null +++ b/vendor/twilio/sdk/.github/workflows/test-and-deploy.yml @@ -0,0 +1,122 @@ +name: Test and Deploy +on: + push: + branches: [ '*' ] + tags: [ '*' ] + pull_request: + branches: [ main ] + schedule: + # Run automatically at 8AM PST Monday-Friday + - cron: '0 15 * * 1-5' + workflow_dispatch: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + matrix: + php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ] + dependencies: + - "lowest" + - "highest" + steps: + - name: Checkout twilio-php + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Setup PHP Action + uses: shivammathur/setup-php@2.15.0 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + id: php + + - name: Composer webhook config + run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + + - name: Update Dependencies + if: matrix.dependencies == 'lowest' + run: composer update --prefer-lowest --prefer-stable -n + + - name: Run Tests + run: make install test + + - name: Fix code coverage paths + run: | + if [ -f "coverage.xml" ]; then + sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml + fi + - name: Run Cluster Test + if: (!github.event.pull_request.head.repo.fork) + env: + TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} + TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} + TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} + TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} + TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} + run: make cluster-test + + - name: Install SonarCloud scanner and run analysis + uses: SonarSource/sonarcloud-github-action@master + if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && matrix.php == '8.1' && matrix.dependencies == 'highest' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + deploy: + name: Deploy + if: success() && github.ref_type == 'tag' + needs: [ test ] + runs-on: ubuntu-latest + steps: + - name: Checkout twilio-php + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install dependencies + run: composer install + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_AUTH_TOKEN }} + + # The expression strips off the shortest match from the front of the string to yield just the tag name as the output + - name: Get tagged version + run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Create GitHub Release + uses: sendgrid/dx-automator/actions/release@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build & Push docker image + run: make docker-build docker-push + + - name: Submit metric to Datadog + uses: sendgrid/dx-automator/actions/datadog-release-metric@main + env: + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + + notify-on-failure: + name: Slack notify on failure + if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') + needs: [ test, deploy ] + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: failure + SLACK_ICON_EMOJI: ':github:' + SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} + SLACK_TITLE: Action Failure - ${{ github.repository }} + SLACK_USERNAME: GitHub Actions + SLACK_MSG_AUTHOR: twilio-dx + SLACK_FOOTER: Posted automatically using GitHub Actions + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + MSG_MINIMAL: true diff --git a/vendor/twilio/sdk/CODE_OF_CONDUCT.md b/vendor/twilio/sdk/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..2f0727e --- /dev/null +++ b/vendor/twilio/sdk/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at open-source@twilio.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/vendor/twilio/sdk/Dockerfile b/vendor/twilio/sdk/Dockerfile new file mode 100644 index 0000000..fde80b9 --- /dev/null +++ b/vendor/twilio/sdk/Dockerfile @@ -0,0 +1,14 @@ +FROM php:7.4 + +RUN apt-get update -y && apt-get install -y zip + +RUN mkdir /twilio +WORKDIR /twilio +ENV PATH="vendor/bin:$PATH" + +COPY src src +COPY tests tests +COPY composer* ./ + +COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +RUN composer install --prefer-dist diff --git a/vendor/twilio/sdk/Dockerfile-dev b/vendor/twilio/sdk/Dockerfile-dev new file mode 100644 index 0000000..7ec9ebc --- /dev/null +++ b/vendor/twilio/sdk/Dockerfile-dev @@ -0,0 +1,16 @@ +ARG version +FROM php:$version + +RUN curl --silent --show-error https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer + +RUN apt-get update -y && \ + apt-get upgrade -y && \ + apt-get dist-upgrade -y && \ + apt-get -y autoremove && \ + apt-get clean + +RUN apt-get install -y zip unzip git + +ENV COMPOSER_ALLOW_SUPERUSER=1 +WORKDIR /twilio diff --git a/vendor/twilio/sdk/PULL_REQUEST_TEMPLATE.md b/vendor/twilio/sdk/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..95ffa50 --- /dev/null +++ b/vendor/twilio/sdk/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,31 @@ + + +# Fixes # + +A short description of what this PR does. + +### Checklist +- [x] I acknowledge that all my contributions will be made under the project's license +- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) +- [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-php/blob/main/CONTRIBUTING.md) and my PR follows them +- [ ] I have titled the PR appropriately +- [ ] I have updated my branch with the main branch +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added the necessary documentation about the functionality in the appropriate .md file +- [ ] I have added inline documentation to the code I modified + +If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. diff --git a/vendor/twilio/sdk/advanced-examples/custom-http-client.md b/vendor/twilio/sdk/advanced-examples/custom-http-client.md new file mode 100644 index 0000000..140986c --- /dev/null +++ b/vendor/twilio/sdk/advanced-examples/custom-http-client.md @@ -0,0 +1,202 @@ +# Custom HTTP Clients for the Twilio PHP Helper Library + +If you are working with the Twilio PHP Helper Library and need to modify the HTTP requests that the library makes to the Twilio servers you’re in the right place. The most common place you'll need to alter the HTTP request is to connect and authenticate with an enterprise’s proxy server. We’ll provide sample code that you can drop right into your app to handle this use case. + +## Connect and authenticate with a proxy server + +To connect and provide credentials to a proxy server between your app and Twilio, you need a way to modify the HTTP requests that the Twilio helper library makes to invoke the Twilio REST API. + +In PHP, the Twilio helper library uses the [cURL](http://php.net/manual/en/book.curl.php) library under the hood to make HTTP requests. The Twilio Helper Library allows you to provide your own `HttpClient` for making API requests. + +How do we apply this to a typical Twilio REST API example? + +```php +messages + ->create( + "+15558675310", + array( + 'body' => "Hey there!", + 'from' => "+15017122661" + ) + ); +``` + +Where does `HttpClient` get created and used? + +Out of the box, the helper library is creating a default `RequestClient` for you, using the Twilio credentials you pass to the `init` method. However, there’s nothing stopping you from creating your own `RequestClient`. + +Once you have your own `RequestClient`, you can pass it to any Twilio REST API resource action you want. Here’s an example of sending an SMS message with a custom client: + +```php +load(); + +use Twilio\Rest\Client; + +// Your Account Sid and Auth Token from twilio.com/console +$sid = getenv('ACCOUNT_SID'); +$token = getenv('AUTH_TOKEN'); +$proxy = getenv('PROXY'); + +$httpClient = new MyRequestClass($proxy); +$twilio = new Client($sid, $token, null, null, $httpClient); + +$message = $twilio->messages + ->create( + "+15558675310", + array( + 'body' => "Hey there!", + 'from' => "+15017122661" + ) + ); + +print("Message SID: {$message->sid}"); +``` + +## Call Twilio through a proxy server + +Now that we understand how all the components fit together we can create our own `HttpClient` that can connect through a proxy server. To make this reusable, here’s a class that you can use to create this `HttpClient` whenever you need one. + +```php +proxy = $proxy; + $this->cainfo = $cainfo; + $this->http = new CurlClient(); + } + + public function request( + $method, + $url, + $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null): Response + { + // Here you can change the URL, headers and other request parameters + $options = $this->options( + $method, + $url, + $params, + $data, + $headers, + $user, + $password, + $timeout + ); + + $curl = curl_init($url); + curl_setopt_array($curl, $options); + if (!empty($this->proxy)) + curl_setopt($curl, CURLOPT_PROXY, $this->proxy); + + if (!empty($this->cainfo)) + curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); + $response = curl_exec($curl); + + $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + $head = substr($response, 0, $headerSize); + $body = substr($response, $headerSize); + + $responseHeaders = array(); + $headerLines = preg_split("/\r?\n/", $head); + foreach ($headerLines as $line) { + if (!preg_match("/:/", $line)) + continue; + list($key, $value) = explode(':', $line, 2); + $responseHeaders[trim($key)] = trim($value); + } + + curl_close($curl); + + if (isset($buffer) && is_resource($buffer)) { + fclose($buffer); + } + return new Response($statusCode, $body, $responseHeaders); + } +} +``` + +In this example, we are using some environment variables loaded at the program startup to retrieve various configuration settings: + +- Your Twilio Account Sid and Auth Token ([found here, in the Twilio console](https://console.twilio.com)) +- A proxy address in IP:Port form, e.g. `127.0.0.1:8888` + +Place these setting in an `.env` file like so: + +```env +ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +AUTH_TOKEN= your_auth_token + +PROXY=127.0.0.1:8888 +``` + +Here’s the full console program that loads the `.env` file and sends a text message to show everything fitting together. + +```php +load(); + +use Twilio\Rest\Client; + +// Your Account Sid and Auth Token from twilio.com/console +$sid = getenv('ACCOUNT_SID'); +$token = getenv('AUTH_TOKEN'); +$proxy = getenv('PROXY'); + +$httpClient = new MyRequestClass($proxy); +$twilio = new Client($sid, $token, null, null, $httpClient); + +$message = $twilio->messages + ->create( + "+15558675310", + array( + 'body' => "Hey there!", + 'from' => "+15017122661" + ) + ); + +print("Message SID: {$message->sid}"); +``` + +## What else can this technique be used for? + +Now that you know how to inject your own httpClient into the Twilio API request pipeline, you could use this technique to add custom HTTP headers and authorization to the requests (perhaps as required by an upstream proxy server). + +You could also implement your own httpClient to mock the Twilio API responses so your unit and integration tests can run without the need to make a connection to Twilio. In fact, there’s already an example online showing [how to do exactly that with Node.js and Prism](https://www.twilio.com/docs/openapi/mock-api-generation-with-twilio-openapi-spec). + +We can’t wait to see what you build! diff --git a/vendor/twilio/sdk/composer.json b/vendor/twilio/sdk/composer.json new file mode 100644 index 0000000..fa61a9d --- /dev/null +++ b/vendor/twilio/sdk/composer.json @@ -0,0 +1,38 @@ +{ + "name": "twilio/sdk", + "type": "library", + "description": "A PHP wrapper for Twilio's API", + "keywords": ["twilio", "sms", "api"], + "homepage": "https://github.com/twilio/twilio-php", + "license": "MIT", + "authors": [ + { + "name": "Twilio API Team", + "email": "api@twilio.com" + } + ], + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "phpunit/phpunit": ">=7.0 < 10" + }, + "suggest": { + "guzzlehttp/guzzle": "An HTTP client to execute the API requests" + }, + "autoload": { + "psr-4": { + "Twilio\\": "src/Twilio/" + } + }, + "autoload-dev": { + "psr-4": { + "": "src/Twilio/", + "Twilio\\Tests\\": "tests/Twilio/" + } + }, + "config": { + "lock": false + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/example/call.php b/vendor/twilio/sdk/example/call.php new file mode 100644 index 0000000..a773ab6 --- /dev/null +++ b/vendor/twilio/sdk/example/call.php @@ -0,0 +1,34 @@ +calls->create( + $to, + $from, + ["url" => "https://twilio.com"] +); +print("Call made successfully with sid: ".$call->sid."\n\n"); + +// Get some calls +$callsList = $client->calls->read([],null,2); +foreach ($callsList as $call) { + print("Call {$call->sid}: {$call->duration} seconds\n"); +} \ No newline at end of file diff --git a/vendor/twilio/sdk/example/incomingPhoneNumber.php b/vendor/twilio/sdk/example/incomingPhoneNumber.php new file mode 100644 index 0000000..d23ebb0 --- /dev/null +++ b/vendor/twilio/sdk/example/incomingPhoneNumber.php @@ -0,0 +1,29 @@ +availablePhoneNumbers("XX")->local->read(); + + // Buy the first phone number + if(!empty($numbers)){ + $local = $numbers[0]; + return $client->incomingPhoneNumbers->create(["phoneNumber" => $local->phoneNumber]); + } + + return null; +} + +// Get a number +$number = buyNumber(); +print("Twilio purchased phoneNumber: ".$number->phoneNumber."\n"); \ No newline at end of file diff --git a/vendor/twilio/sdk/example/message.php b/vendor/twilio/sdk/example/message.php new file mode 100644 index 0000000..0c0cdbf --- /dev/null +++ b/vendor/twilio/sdk/example/message.php @@ -0,0 +1,31 @@ +messages->create( + $phoneNumber, + [ + 'from' => $twilioPurchasedNumber, + 'body' => "Hey Jenny! Good luck on the bar exam!" + ] +); +print("Message sent successfully with sid = " . $message->sid ."\n\n"); + +// Print the last 10 messages +$messageList = $client->messages->read([],10); +foreach ($messageList as $msg) { + print("ID:: ". $msg->sid . " | " . "From:: " . $msg->from . " | " . "TO:: " . $msg->to . " | " . " Status:: " . $msg->status . " | " . " Body:: ". $msg->body ."\n"); +} \ No newline at end of file diff --git a/vendor/twilio/sdk/example/messaging_bulk.php b/vendor/twilio/sdk/example/messaging_bulk.php new file mode 100644 index 0000000..3456ad9 --- /dev/null +++ b/vendor/twilio/sdk/example/messaging_bulk.php @@ -0,0 +1,54 @@ + $phoneNumber1, + ] +); +$message2 = MessageModels::createMessagingV1Message( + [ + 'to' => $phoneNumber2, + ] +); + +// Create list of the message objects +$messages = [$message1, $message2]; + +// This must be a Twilio phone number that you own, formatted with a '+' and country code +$twilioPurchasedNumber = "+XXXXXXXXXX"; +// Specify the message to be sent - JSON string supported +$messageBody = "Hello from twilio-php!"; + +// Create Message Request object +$createMessagesRequest = MessageModels::createCreateMessagesRequest( + [ + 'messages' => $messages, + 'from' => $twilioPurchasedNumber, + 'body' => $messageBody, + ] +); + +// Send a Bulk Message +$message = $client->previewMessaging->v1->messages->create($createMessagesRequest); + +// Print how many messages were successful +print($message->successCount . " messages sent successfully!" . "\n\n"); + +// Print the message details +foreach ($message->messageReceipts as $msg) { + print("ID:: " . $msg["sid"] . " | " . "TO:: " . $msg["to"] . "\n"); +} diff --git a/vendor/twilio/sdk/example/record.php b/vendor/twilio/sdk/example/record.php new file mode 100644 index 0000000..071b165 --- /dev/null +++ b/vendor/twilio/sdk/example/record.php @@ -0,0 +1,14 @@ +usage->records->read([], 10); +foreach ($recordList as $record) { + print_r("Record(accountSid=" . $record->accountSid . ", apiVersion=" . $record->apiVersion . ", asOf=" . $record->asOf . ", category=" . $record->category . ", count=" . $record->count . ", countUnit=" . $record->countUnit . ", description=" . $record->description . ", endDate=" . $record->endDate->format("Y-m-d H:i:s") . ", price=" . $record->price . ", priceUnit=" . $record->priceUnit . ", startDate=" . $record->startDate->format("Y-m-d H:i:s") . ", uri=" . $record->uri . ", usage=" . $record->usage . ", usageUnit=" . $record->usageUnit . "\n"); +} \ No newline at end of file diff --git a/vendor/twilio/sdk/example/signingKey.php b/vendor/twilio/sdk/example/signingKey.php new file mode 100644 index 0000000..7769b07 --- /dev/null +++ b/vendor/twilio/sdk/example/signingKey.php @@ -0,0 +1,27 @@ +api->v2010->newSigningKeys->create(); + +// Switch to guzzle client as the default client +$guzzleClient = new Client($signingKey->sid, $signingKey->secret, $sid, null, new \Twilio\Http\GuzzleClient(new \GuzzleHttp\Client)); + +// The phone number you are querying in E.164 or national format. +// If the phone number is provided in national format, please also specify the country in the optional parameter CountryCode. +// Otherwise, CountryCode will default to US. +$number = "+XXXXXXXXXX"; + +// Make REST API requests +$phone_number = $guzzleClient->lookups->v1->phoneNumbers($number) + ->fetch([ + "type" => ["carrier"] + ]); + +print_r($phone_number->carrier); diff --git a/vendor/twilio/sdk/example/trunk.php b/vendor/twilio/sdk/example/trunk.php new file mode 100644 index 0000000..c6ca481 --- /dev/null +++ b/vendor/twilio/sdk/example/trunk.php @@ -0,0 +1,17 @@ +trunking->v1->trunks->create( + [ + "friendlyName" => "shiny trunk", + "secure" => false + ] +); +print("\n".$trunk."\n"); \ No newline at end of file diff --git a/vendor/twilio/sdk/example/twiML.php b/vendor/twilio/sdk/example/twiML.php new file mode 100644 index 0000000..9b3f110 --- /dev/null +++ b/vendor/twilio/sdk/example/twiML.php @@ -0,0 +1,43 @@ + 'woman' +]); + +$play = new \Twilio\TwiML\Voice\Play("https://api.twilio.com/cowbell.mp3", [ + 'loop' => 5 +]); + +$twiml = new VoiceResponse(); +$twiml->append($say); +$twiml->append($play); + +print("TwiML Say and Play: \n{$twiml->asXML()}\n"); + + +// Gather, Redirect +$twimlResponse = new VoiceResponse(); +$gather = $twimlResponse->gather(); +$gather->setNumDigits(10); +$gather->say("Press 1"); +$twimlResponse->redirect("https://example.com"); +print("TwiML Gather and Redirect: \n{$twimlResponse->asXML()}\n"); + + +// Dial +$twimlResponse = new VoiceResponse(); + +// A valid phone number formatted with a '+' and a country code (e.g., +16175551212) +$callerID = '+XXXXXXXX'; +$dial = $twimlResponse->dial('', [ + 'callerId' => $callerID, + 'action' => 'https:///example.com', + 'hangupOnStar' => true, +]); + +$dial->conference("My Room", ["beep" => "true"]); +print("TwiML Dial: \n{$twimlResponse->asXML()}\n"); diff --git a/vendor/twilio/sdk/phpdox.xml b/vendor/twilio/sdk/phpdox.xml new file mode 100644 index 0000000..ba4666a --- /dev/null +++ b/vendor/twilio/sdk/phpdox.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/vendor/twilio/sdk/sonar-project.properties b/vendor/twilio/sdk/sonar-project.properties new file mode 100644 index 0000000..69b1054 --- /dev/null +++ b/vendor/twilio/sdk/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=twilio_twilio-php +sonar.projectName=twilio-php +sonar.organization=twilio + +sonar.sources=src/ +sonar.exclusions=src/Twilio/Rest/**/*, src/Twilio/TwiML/*/*, src/Twilio/TwiML/*Response.php +sonar.tests=tests/ +sonar.test.exclusions=tests/Twilio/Integration/**/* + +# For Code Coverage analysis +sonar.php.coverage.reportPaths=coverage.xml diff --git a/vendor/twilio/sdk/src/Twilio/Base/BaseClient.php b/vendor/twilio/sdk/src/Twilio/Base/BaseClient.php new file mode 100644 index 0000000..d19fdb2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Base/BaseClient.php @@ -0,0 +1,388 @@ +environment = $environment ?: \getenv(); + + $this->username = $this->getArg($username, self::ENV_ACCOUNT_SID); + $this->password = $this->getArg($password, self::ENV_AUTH_TOKEN); + $this->region = $this->getArg($region, self::ENV_REGION); + $this->edge = $this->getArg(null, self::ENV_EDGE); + $this->logLevel = $this->getArg(null, self::ENV_LOG); + $this->userAgentExtensions = $userAgentExtensions ?: []; + + if (!$this->username || !$this->password) { + throw new ConfigurationException('Credentials are required to create a Client'); + } + + $this->accountSid = $accountSid ?: $this->username; + + if ($httpClient) { + $this->httpClient = $httpClient; + } else { + $this->httpClient = new CurlClient(); + } + } + + /** + * Determines argument value accounting for environment variables. + * + * @param string $arg The constructor argument + * @param string $envVar The environment variable name + * @return ?string Argument value + */ + public function getArg(?string $arg, string $envVar): ?string + { + if ($arg) { + return $arg; + } + + if (\array_key_exists($envVar, $this->environment)) { + return $this->environment[$envVar]; + } + + return null; + } + + /** + * 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( + string $method, + string $uri, + array $params = [], + array $data = [], + array $headers = [], + string $username = null, + string $password = null, + int $timeout = null + ): \Twilio\Http\Response{ + $username = $username ?: $this->username; + $password = $password ?: $this->password; + $logLevel = (getenv('DEBUG_HTTP_TRAFFIC') === 'true' ? 'debug' : $this->getLogLevel()); + + $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . + ' (' . php_uname("s") . ' ' . php_uname("m") . ')' . + ' PHP/' . PHP_VERSION; + $headers['Accept-Charset'] = 'utf-8'; + + if ($this->userAgentExtensions) { + $headers['User-Agent'] .= ' ' . implode(' ', $this->userAgentExtensions); + } + + if (!\array_key_exists('Accept', $headers)) { + $headers['Accept'] = 'application/json'; + } + + $uri = $this->buildUri($uri); + + if ($logLevel === 'debug') { + error_log('-- BEGIN Twilio API Request --'); + error_log('Request Method: ' . $method); + $u = parse_url($uri); + if (isset($u['path'])) { + error_log('Request URL: ' . $u['path']); + } + if (isset($u['query']) && strlen($u['query']) > 0) { + error_log('Query Params: ' . $u['query']); + } + error_log('Request Headers: '); + foreach ($headers as $key => $value) { + if (strpos(strtolower($key), 'authorization') === false) { + error_log("$key: $value"); + } + } + error_log('-- END Twilio API Request --'); + } + + $response = $this->getHttpClient()->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($logLevel === 'debug') { + error_log('Status Code: ' . $response->getStatusCode()); + error_log('Response Headers:'); + $responseHeaders = $response->getHeaders(); + foreach ($responseHeaders as $key => $value) { + error_log("$key: $value"); + } + } + + return $response; + } + + /** + * Build the final request uri + * + * @param string $uri The original request uri + * @return string Request uri + */ + public function buildUri(string $uri): string + { + if ($this->region == null && $this->edge == null) { + return $uri; + } + + $parsedUrl = \parse_url($uri); + $pieces = \explode('.', $parsedUrl['host']); + $product = $pieces[0]; + $domain = \implode('.', \array_slice($pieces, -2)); + $newEdge = $this->edge; + $newRegion = $this->region; + if (count($pieces) == 4) { // product.region.twilio.com + $newRegion = $newRegion ?: $pieces[1]; + } elseif (count($pieces) == 5) { // product.edge.region.twilio.com + $newEdge = $newEdge ?: $pieces[1]; + $newRegion = $newRegion ?: $pieces[2]; + } + + if ($newEdge != null && $newRegion == null) { + $newRegion = self::DEFAULT_REGION; + } + + $parsedUrl['host'] = \implode('.', \array_filter([$product, $newEdge, $newRegion, $domain])); + return RequestValidator::unparse_url($parsedUrl); + } + + /** + * 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(string $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(string $name, array $arguments) + { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Client ' . $this->getAccountSid() . ']'; + } + + /** + * Validates connection to new SSL certificate endpoint + * + * @param CurlClient $client + * @throws TwilioException if request fails + */ + public function validateSslCertificate(CurlClient $client): void + { + $response = $client->request('GET', 'https://tls-test.twilio.com:443'); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { + throw new TwilioException('Failed to validate SSL certificate'); + } + } + + /** + * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the + * authenticating account + */ + public function getAccount(): \Twilio\Rest\Api\V2010\AccountContext + { + return $this->api->v2010->account; + } + + /** + * Retrieve the Username + * + * @return string Current Username + */ + public function getUsername(): string + { + return $this->username; + } + + /** + * Retrieve the Password + * + * @return string Current Password + */ + public function getPassword(): string + { + return $this->password; + } + + /** + * Retrieve the AccountSid + * + * @return string Current AccountSid + */ + public function getAccountSid(): string + { + return $this->accountSid; + } + + /** + * Retrieve the Region + * + * @return string Current Region + */ + public function getRegion(): string + { + return $this->region; + } + + /** + * Retrieve the Edge + * + * @return string Current Edge + */ + public function getEdge(): string + { + return $this->edge; + } + + /** + * Set Edge + * + * @param string $uri Edge to use, unsets the Edge when called with no arguments + */ + public function setEdge(string $edge = null): void + { + $this->edge = $this->getArg($edge, self::ENV_EDGE); + } + + /** + * Retrieve the HttpClient + * + * @return HttpClient Current HttpClient + */ + public function getHttpClient(): HttpClient + { + return $this->httpClient; + } + + /** + * Set the HttpClient + * + * @param HttpClient $httpClient HttpClient to use + */ + public function setHttpClient(HttpClient $httpClient): void + { + $this->httpClient = $httpClient; + } + + /** + * Retrieve the log level + * + * @return ?string Current log level + */ + public function getLogLevel(): ?string + { + return $this->logLevel; + } + + /** + * Set log level to debug + * + * @param string $logLevel log level to use + */ + public function setLogLevel(string $logLevel = null): void + { + $this->logLevel = $this->getArg($logLevel, self::ENV_LOG); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Base/PhoneNumberCapabilities.php b/vendor/twilio/sdk/src/Twilio/Base/PhoneNumberCapabilities.php new file mode 100644 index 0000000..59f001b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Base/PhoneNumberCapabilities.php @@ -0,0 +1,80 @@ +mms = Values::array_get($capabilities, 'mms', "false"); + $this->sms = Values::array_get($capabilities, 'sms', "false"); + $this->voice = Values::array_get($capabilities, 'voice', "false"); + $this->fax = Values::array_get($capabilities, 'fax', "false"); + } + + /** + * Access the mms + */ + public function getMms(): bool + { + return $this->mms; + } + + /** + * Access the sms + */ + public function getSms(): bool + { + return $this->sms; + } + + /** + * Access the voice + */ + public function getVoice(): bool + { + return $this->voice; + } + + /** + * Access the fax + */ + public function getFax(): bool + { + return $this->fax; + } + + public function __get(string $name) + { + if (\property_exists($this, $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + throw new TwilioException('Unknown subresource ' . $name); + } + + public function __toString(): string + { + return "[Twilio.Base.PhoneNumberCapabilities " . + "( + mms: " . json_encode($this->mms) . ", + sms: " . json_encode($this->sms) . ", + voice: " . json_encode($this->voice) . ", + fax: " . json_encode($this->fax) . " + )]"; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Deserialize.php b/vendor/twilio/sdk/src/Twilio/Deserialize.php new file mode 100644 index 0000000..f0d9967 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Deserialize.php @@ -0,0 +1,51 @@ + 0) { + return new PhoneNumberCapabilities($arr); + } + } + } catch (\Exception $e) { + // no-op + } + + return $arr; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Domain.php b/vendor/twilio/sdk/src/Twilio/Domain.php new file mode 100644 index 0000000..cbf6dd2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Domain.php @@ -0,0 +1,82 @@ +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(string $uri): string { + return \implode('/', [\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 int $timeout Request timeout + * @return Response the response for the request + */ + public function request(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + $url = $this->absoluteUrl($uri); + return $this->client->request( + $method, + $url, + $params, + $data, + $headers, + $user, + $password, + $timeout + ); + } + + public function getClient(): Client { + return $this->client; + } + + public function __toString(): string { + return '[Domain]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Exceptions/ConfigurationException.php b/vendor/twilio/sdk/src/Twilio/Exceptions/ConfigurationException.php new file mode 100644 index 0000000..985cc4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Exceptions/ConfigurationException.php @@ -0,0 +1,9 @@ +statusCode = $statusCode; + $this->moreInfo = $moreInfo; + $this->details = $details; + parent::__construct($message, $code); + } + + /** + * Get the HTTP Status Code of the RestException + * @return int HTTP Status Code + */ + public function getStatusCode(): int { + return $this->statusCode; + } + + /** + * Get more information of the RestException + * @return string More error information + */ + public function getMoreInfo(): string { + return $this->moreInfo; + } + + /** + * Get the details of the RestException + * @return exception details + */ + public function getDetails(): array { + return $this->details; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Exceptions/TwilioException.php b/vendor/twilio/sdk/src/Twilio/Exceptions/TwilioException.php new file mode 100644 index 0000000..fc0a53b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Exceptions/TwilioException.php @@ -0,0 +1,9 @@ +curlOptions = $options; + } + + public function request(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + $options = $this->options($method, $url, $params, $data, $headers, + $user, $password, $timeout); + + $this->lastRequest = $options; + $this->lastResponse = null; + + try { + if (!$curl = \curl_init()) { + throw new EnvironmentException('Unable to initialize cURL'); + } + + if (!\curl_setopt_array($curl, $options)) { + throw new EnvironmentException(\curl_error($curl)); + } + + if (!$response = \curl_exec($curl)) { + throw new EnvironmentException(\curl_error($curl)); + } + + $parts = \explode("\r\n\r\n", $response, 3); + + list($head, $body) = ( + \preg_match('/\AHTTP\/1.\d 100 Continue\Z/', $parts[0]) + || \preg_match('/\AHTTP\/1.\d 200 Connection established\Z/', $parts[0]) + || \preg_match('/\AHTTP\/1.\d 200 Tunnel established\Z/', $parts[0]) + ) + ? array($parts[1], $parts[2]) + : array($parts[0], $parts[1]); + + $statusCode = \curl_getinfo($curl, CURLINFO_HTTP_CODE); + + $responseHeaders = []; + $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($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { + \fclose($options[CURLOPT_INFILE]); + } + + $this->lastResponse = new Response($statusCode, $body, $responseHeaders); + + return $this->lastResponse; + } catch (\ErrorException $e) { + if (isset($curl) && \is_resource($curl)) { + \curl_close($curl); + } + + if (isset($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { + \fclose($options[CURLOPT_INFILE]); + } + + throw $e; + } + } + + public function options(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): array { + $timeout = $timeout ?? self::DEFAULT_TIMEOUT; + $options = $this->curlOptions + [ + CURLOPT_URL => $url, + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_INFILESIZE => Null, + CURLOPT_HTTPHEADER => [], + 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"); + } + + $query = $this->buildQuery($params); + if ($query) { + $options[CURLOPT_URL] .= '?' . $query; + } + + switch (\strtolower(\trim($method))) { + case 'get': + $options[CURLOPT_HTTPGET] = true; + break; + case 'post': + $options[CURLOPT_POST] = true; + if ($this->hasFile($data)) { + [$headers, $body] = $this->buildMultipartOptions($data); + $options[CURLOPT_POSTFIELDS] = $body; + $options[CURLOPT_HTTPHEADER] = \array_merge($options[CURLOPT_HTTPHEADER], $headers); + } + elseif ($headers['Content-Type'] === 'application/json') { + $options[CURLOPT_POSTFIELDS] = json_encode($data); + } + else { + $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); + } + + break; + case 'put': + $options[CURLOPT_CUSTOMREQUEST] = 'PUT'; + if ($this->hasFile($data)) { + [$headers, $body] = $this->buildMultipartOptions($data); + $options[CURLOPT_POSTFIELDS] = $body; + $options[CURLOPT_HTTPHEADER] = \array_merge($options[CURLOPT_HTTPHEADER], $headers); + } + elseif ($headers['Content-Type'] === 'application/json') { + $options[CURLOPT_POSTFIELDS] = json_encode($data); + } + else { + $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); + } + break; + case 'head': + $options[CURLOPT_NOBODY] = true; + break; + default: + $options[CURLOPT_CUSTOMREQUEST] = \strtoupper($method); + } + + return $options; + } + + public function buildQuery(?array $params): string { + $parts = []; + $params = $params ?: []; + + 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); + } + + private function hasFile(array $data): bool { + foreach ($data as $value) { + if ($value instanceof File) { + return true; + } + } + + return false; + } + + private function buildMultipartOptions(array $data): array { + $boundary = \uniqid('', true); + $delimiter = "-------------{$boundary}"; + $body = ''; + + foreach ($data as $key => $value) { + if ($value instanceof File) { + $contents = $value->getContents(); + if ($contents === null) { + $chunk = \file_get_contents($value->getFileName()); + $filename = \basename($value->getFileName()); + } elseif (\is_resource($contents)) { + $chunk = ''; + while (!\feof($contents)) { + $chunk .= \fread($contents, 8096); + } + + $filename = $value->getFileName(); + } elseif (\is_string($contents)) { + $chunk = $contents; + $filename = $value->getFileName(); + } else { + throw new \InvalidArgumentException('Unsupported content type'); + } + + $headers = ''; + $contentType = $value->getContentType(); + if ($contentType !== null) { + $headers .= "Content-Type: {$contentType}\r\n"; + } + + $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n%s\r\n%s\r\n", [ + $delimiter, + $key, + $filename, + $headers, + $chunk, + ]); + } else { + $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", [ + $delimiter, + $key, + $value, + ]); + } + } + + $body .= "--{$delimiter}--\r\n"; + + return [ + [ + "Content-Type: multipart/form-data; boundary={$delimiter}", + 'Content-Length: ' . \strlen($body), + ], + $body, + ]; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Http/File.php b/vendor/twilio/sdk/src/Twilio/Http/File.php new file mode 100644 index 0000000..304e772 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Http/File.php @@ -0,0 +1,47 @@ +fileName = $fileName; + $this->contents = $contents; + $this->contentType = $contentType; + } + + /** + * @return resource|string|mixed|null + */ + public function getContents() { + return $this->contents; + } + + public function getFileName(): string { + return $this->fileName; + } + + public function getContentType(): ?string { + return $this->contentType; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Http/GuzzleClient.php b/vendor/twilio/sdk/src/Twilio/Http/GuzzleClient.php new file mode 100644 index 0000000..8b88b09 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Http/GuzzleClient.php @@ -0,0 +1,99 @@ +client = $client; + } + + public function request(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + try { + $options = [ + 'timeout' => $timeout, + 'auth' => [$user, $password], + 'allow_redirects' => false, + ]; + + if ($params) { + $options['query'] = Query::build($params, PHP_QUERY_RFC1738); + } + + if ($method === 'POST' || $method === 'PUT') { + if ($this->hasFile($data)) { + $options['multipart'] = $this->buildMultipartParam($data); + } else { + $options['body'] = Query::build($data, PHP_QUERY_RFC1738); + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + } + } + + $response = $this->client->send(new Request($method, $url, $headers), $options); + } catch (BadResponseException $exception) { + $response = $exception->getResponse(); + } catch (\Exception $exception) { + throw new HttpException('Unable to complete the HTTP request', 0, $exception); + } + + // Casting the body (stream) to a string performs a rewind, ensuring we return the entire response. + // See https://stackoverflow.com/a/30549372/86696 + return new Response($response->getStatusCode(), (string)$response->getBody(), $response->getHeaders()); + } + + private function hasFile(array $data): bool { + foreach ($data as $value) { + if ($value instanceof File) { + return true; + } + } + + return false; + } + + private function buildMultipartParam(array $data): array { + $multipart = []; + foreach ($data as $key => $value) { + if ($value instanceof File) { + $contents = $value->getContents(); + if ($contents === null) { + $contents = fopen($value->getFileName(), 'rb'); + } + + $chunk = [ + 'name' => $key, + 'contents' => $contents, + 'filename' => $value->getFileName(), + ]; + + if ($value->getContentType() !== null) { + $chunk['headers']['Content-Type'] = $value->getContentType(); + } + } else { + $chunk = [ + 'name' => $key, + 'contents' => $value, + ]; + } + + $multipart[] = $chunk; + } + + return $multipart; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Http/Response.php b/vendor/twilio/sdk/src/Twilio/Http/Response.php new file mode 100644 index 0000000..5b55956 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Http/Response.php @@ -0,0 +1,40 @@ +statusCode = $statusCode; + $this->content = $content; + $this->headers = $headers; + } + + /** + * @return mixed + */ + public function getContent() { + return \json_decode($this->content, true); + } + + public function getStatusCode(): int { + return $this->statusCode; + } + + public function getHeaders(): array { + return $this->headers; + } + + public function ok(): bool { + return $this->getStatusCode() < 400; + } + + public function __toString(): string { + return '[Response] HTTP ' . $this->getStatusCode() . ' ' . $this->content; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/InstanceContext.php b/vendor/twilio/sdk/src/Twilio/InstanceContext.php new file mode 100644 index 0000000..cd87bd8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/InstanceContext.php @@ -0,0 +1,19 @@ +version = $version; + } + + public function __toString(): string { + return '[InstanceContext]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/InstanceResource.php b/vendor/twilio/sdk/src/Twilio/InstanceResource.php new file mode 100644 index 0000000..798546b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/InstanceResource.php @@ -0,0 +1,28 @@ +version = $version; + } + + public function toArray(): array { + return $this->properties; + } + + public function __toString(): string { + return '[InstanceResource]'; + } + + public function __isset($name): bool { + return \array_key_exists($name, $this->properties); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/AccessToken.php b/vendor/twilio/sdk/src/Twilio/Jwt/AccessToken.php new file mode 100644 index 0000000..4ac8a3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/AccessToken.php @@ -0,0 +1,169 @@ +signingKeySid = $signingKeySid; + $this->accountSid = $accountSid; + $this->secret = $secret; + $this->ttl = $ttl; + $this->region = $region; + + if ($identity !== null) { + $this->identity = $identity; + } + + $this->grants = []; + $this->customClaims = []; + } + + /** + * Set the identity of this access token + * + * @param string $identity identity of the grant + * + * @return $this updated access token + */ + public function setIdentity(string $identity): self { + $this->identity = $identity; + return $this; + } + + /** + * Returns the identity of the grant + * + * @return string the identity + */ + public function getIdentity(): string { + return $this->identity; + } + + /** + * Set the nbf of this access token + * + * @param int $nbf nbf in epoch seconds of the grant + * + * @return $this updated access token + */ + public function setNbf(int $nbf): self { + $this->nbf = $nbf; + return $this; + } + + /** + * Returns the nbf of the grant + * + * @return int the nbf in epoch seconds + */ + public function getNbf(): int { + return $this->nbf; + } + + /** + * Set the region of this access token + * + * @param string $region Home region of the account sid in this access token + * + * @return $this updated access token + */ + public function setRegion(string $region): self { + $this->region = $region; + return $this; + } + + /** + * Returns the region of this access token + * + * @return string Home region of the account sid in this access token + */ + public function getRegion(): string { + return $this->region; + } + + /** + * Add a grant to the access token + * + * @param Grant $grant to be added + * + * @return $this the updated access token + */ + public function addGrant(Grant $grant): self { + $this->grants[] = $grant; + return $this; + } + + /** + * Allows to set custom claims, which then will be encoded into JWT payload. + * + * @param string $name + * @param string $value + */ + public function addClaim(string $name, string $value): void { + $this->customClaims[$name] = $value; + } + + public function toJWT(string $algorithm = 'HS256'): string { + $header = [ + 'cty' => 'twilio-fpa;v=1', + 'typ' => 'JWT' + ]; + + if ($this->region) { + $header['twr'] = $this->region; + } + + $now = \time(); + + $grants = []; + if ($this->identity) { + $grants['identity'] = $this->identity; + } + + foreach ($this->grants as $grant) { + $payload = $grant->getPayload(); + if (empty($payload)) { + $payload = \json_decode('{}'); + } + + $grants[$grant->getGrantKey()] = $payload; + } + + if (empty($grants)) { + $grants = \json_decode('{}'); + } + + $payload = \array_merge($this->customClaims, [ + 'jti' => $this->signingKeySid . '-' . $now, + 'iss' => $this->signingKeySid, + 'sub' => $this->accountSid, + 'exp' => $now + $this->ttl, + 'grants' => $grants + ]); + + if ($this->nbf !== null) { + $payload['nbf'] = $this->nbf; + } + + return JWT::encode($payload, $this->secret, $algorithm, $header); + } + + public function __toString(): string { + return $this->toJWT(); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Client/ScopeURI.php b/vendor/twilio/sdk/src/Twilio/Jwt/Client/ScopeURI.php new file mode 100644 index 0000000..3340f94 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Client/ScopeURI.php @@ -0,0 +1,67 @@ +:? + * + * For example: + * scope:client:incoming?name=jonas + */ +class ScopeURI { + public $service; + public $privilege; + public $params; + + public function __construct(string $service, string $privilege, array $params = []) { + $this->service = $service; + $this->privilege = $privilege; + $this->params = $params; + } + + public function toString(): string { + $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(string $uri): ScopeURI { + 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'); + } + + [$scheme, $service, $privilege] = $parts; + return new ScopeURI($service, $privilege, $params); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/ClientToken.php b/vendor/twilio/sdk/src/Twilio/Jwt/ClientToken.php new file mode 100644 index 0000000..8e32432 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/ClientToken.php @@ -0,0 +1,128 @@ +accountSid = $accountSid; + $this->authToken = $authToken; + $this->scopes = []; + $this->clientName = false; + $this->customClaims = []; + } + + /** + * 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 string $clientName + * @throws \InvalidArgumentException + */ + public function allowClientIncoming(string $clientName): void { + // 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 ($clientName === '') { + throw new \InvalidArgumentException( + 'Client name must not be a zero length string.'); + } + + $this->clientName = $clientName; + $this->allow('client', 'incoming', ['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(string $appSid, array $appParams = []): void { + $this->allow('client', 'outgoing', [ + '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 = []): void { + $this->allow('stream', 'subscribe', [ + 'path' => '/2010-04-01/Events', + 'params' => \http_build_query($filters, '', '&'), + ]); + } + + /** + * Allows to set custom claims, which then will be encoded into JWT payload. + * + * @param string $name + * @param string $value + */ + public function addClaim(string $name, string $value): void { + $this->customClaims[$name] = $value; + } + + /** + * Generates a new token based on the credentials and permissions that + * previously has been granted to this token. + * + * @param int $ttl the expiration time of the token (in seconds). Default + * value is 3600 (1hr) + * @return string the newly generated token that is valid for $ttl seconds + */ + public function generateToken(int $ttl = 3600): string { + $payload = \array_merge($this->customClaims, [ + 'scope' => [], + 'iss' => $this->accountSid, + 'exp' => \time() + $ttl, + ]); + $scopeStrings = []; + + 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(string $service, string $privilege, array $params): void { + $this->scopes[] = new ScopeURI($service, $privilege, $params); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/ChatGrant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/ChatGrant.php new file mode 100644 index 0000000..2dfa9dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/ChatGrant.php @@ -0,0 +1,128 @@ +serviceSid; + } + + /** + * Set the service sid of this grant + * + * @param string $serviceSid service sid of the grant + * + * @return $this updated grant + */ + public function setServiceSid(string $serviceSid): self { + $this->serviceSid = $serviceSid; + return $this; + } + + /** + * Returns the endpoint id of the grant + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + 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(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the deployment role sid of the grant + * + * @return string the deployment role sid + */ + public function getDeploymentRoleSid(): string { + 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(string $deploymentRoleSid): self { + $this->deploymentRoleSid = $deploymentRoleSid; + return $this; + } + + /** + * Returns the push credential sid of the grant + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + 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(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'chat'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + 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; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/Grant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/Grant.php new file mode 100644 index 0000000..faf55ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/Grant.php @@ -0,0 +1,21 @@ +grant; + } + + /** + * Set the playback grant that will allow access to a stream + * + * @param array $grant playback grant from Twilio API + * @return $this updated grant + */ + public function setGrant(array $grant): self { + $this->grant = $grant; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'player'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->grant) { + $payload = $this->grant; + } + return $payload; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/SyncGrant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/SyncGrant.php new file mode 100644 index 0000000..ad7889d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/SyncGrant.php @@ -0,0 +1,126 @@ +serviceSid; + } + + /** + * Set the service sid of this grant + * + * @param string $serviceSid service sid of the grant + * + * @return $this updated grant + */ + public function setServiceSid(string $serviceSid): self { + $this->serviceSid = $serviceSid; + return $this; + } + + /** + * Returns the endpoint id of the grant + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + 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(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the deployment role sid of the grant + * + * @return string the deployment role sid + */ + public function getDeploymentRoleSid(): string { + 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(string $deploymentRoleSid): self { + $this->deploymentRoleSid = $deploymentRoleSid; + return $this; + } + + /** + * Returns the push credential sid of the grant + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + 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(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'data_sync'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + 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; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/TaskRouterGrant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/TaskRouterGrant.php new file mode 100644 index 0000000..8707c66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/TaskRouterGrant.php @@ -0,0 +1,101 @@ +workspaceSid; + } + + /** + * Set the workspace sid of this grant + * + * @param string $workspaceSid workspace sid of the grant + * + * @return $this updated grant + */ + public function setWorkspaceSid(string $workspaceSid): self { + $this->workspaceSid = $workspaceSid; + return $this; + } + + /** + * Returns the worker sid + * + * @return string the worker sid + */ + public function getWorkerSid(): string { + return $this->workerSid; + } + + /** + * Set the worker sid of this grant + * + * @param string $workerSid worker sid of the grant + * + * @return $this updated grant + */ + public function setWorkerSid(string $workerSid): self { + $this->workerSid = $workerSid; + return $this; + } + + /** + * Returns the role + * + * @return string the role + */ + public function getRole(): string { + return $this->role; + } + + /** + * Set the role of this grant + * + * @param string $role role of the grant + * + * @return $this updated grant + */ + public function setRole(string $role): self { + $this->role = $role; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'task_router'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + 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; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VideoGrant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VideoGrant.php new file mode 100644 index 0000000..25887ce --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VideoGrant.php @@ -0,0 +1,52 @@ +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(string $roomSidOrName): self { + $this->room = $roomSidOrName; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'video'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->room) { + $payload['room'] = $this->room; + } + return $payload; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VoiceGrant.php b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VoiceGrant.php new file mode 100644 index 0000000..a3608b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/Grants/VoiceGrant.php @@ -0,0 +1,165 @@ +incomingAllow; + } + + /** + * Set whether incoming is allowed + * + * @param bool $incomingAllow whether incoming is allowed + * + * @return $this updated grant + */ + public function setIncomingAllow(bool $incomingAllow): self { + $this->incomingAllow = $incomingAllow; + return $this; + } + + /** + * Returns the outgoing application sid + * + * @return string the outgoing application sid + */ + public function getOutgoingApplicationSid(): string { + 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(string $outgoingApplicationSid): self { + $this->outgoingApplicationSid = $outgoingApplicationSid; + return $this; + } + + /** + * Returns the outgoing application params + * + * @return array the outgoing application params + */ + public function getOutgoingApplicationParams(): array { + return $this->outgoingApplicationParams; + } + + /** + * Set the outgoing application of the the grant + * + * @param string $sid outgoing application sid of the grant + * @param array $params params to pass the the application + * + * @return $this updated grant + */ + public function setOutgoingApplication(string $sid, array $params): self { + $this->outgoingApplicationSid = $sid; + $this->outgoingApplicationParams = $params; + return $this; + } + + /** + * Returns the push credential sid + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + return $this->pushCredentialSid; + } + + /** + * Set the push credential sid + * + * @param string $pushCredentialSid + * + * @return $this updated grant + */ + public function setPushCredentialSid(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the endpoint id + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + return $this->endpointId; + } + + /** + * Set the endpoint id + * + * @param string $endpointId endpoint id + * + * @return $this updated grant + */ + public function setEndpointId(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'voice'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->incomingAllow === true) { + $incoming = []; + $incoming['allow'] = true; + $payload['incoming'] = $incoming; + } + + if ($this->outgoingApplicationSid) { + $outgoing = []; + $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; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/JWT.php b/vendor/twilio/sdk/src/Twilio/Jwt/JWT.php new file mode 100644 index 0000000..8e1cbd2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/JWT.php @@ -0,0 +1,172 @@ + + */ +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(string $jwt, string $key = null, bool $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 (!hash_equals($sig, self::sign("$headb64.$payloadb64", $key, $header->alg))) { + throw new \UnexpectedValueException('Signature verification failed'); + } + } + return $payload; + } + + /** + * @param string $jwt The JWT + * @return object The JWT's header as a PHP object + * @throws \UnexpectedValueException + */ + public static function getHeader(string $jwt) { + $tks = \explode('.', $jwt); + if (\count($tks) !== 3) { + throw new \UnexpectedValueException('Wrong number of segments'); + } + list($headb64) = $tks; + if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) + ) { + throw new \UnexpectedValueException('Invalid segment encoding'); + } + return $header; + } + + /** + * @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, string $key, string $algo = 'HS256', array $additionalHeaders = []): string { + $header = ['typ' => 'JWT', 'alg' => $algo]; + $header += $additionalHeaders; + + $segments = []; + $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(string $msg, string $key, string $method = 'HS256'): string { + $methods = [ + '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(string $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): string { + $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(string $input): string { + $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(string $input): string { + return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); + } + + /** + * @param int $errno An error number from json_last_error() + * + * @throws \DomainException + */ + private static function handleJsonError(int $errno): void { + $messages = [ + 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($messages[$errno] ?? 'Unknown JSON error: ' . $errno); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/CapabilityToken.php b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/CapabilityToken.php new file mode 100644 index 0000000..e2ed051 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/CapabilityToken.php @@ -0,0 +1,161 @@ + + * @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 = ['required' => true]; + protected $optional = ['required' => false]; + + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $channelId, + string $resourceUrl = null, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { + $this->accountSid = $accountSid; + $this->authToken = $authToken; + $this->friendlyName = $channelId; + $this->policies = []; + + $this->workspaceSid = $workspaceSid; + $this->channelId = $channelId; + if (isset($overrideBaseUrl)) { + $this->baseUrl = $overrideBaseUrl; + } + if (isset($overrideBaseWSUrl)) { + $this->baseWsUrl = $overrideBaseWSUrl; + } + $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(): void { + } + + public function addPolicyDeconstructed(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true): Policy { + $policy = new Policy($url, $method, $queryFilter, $postFilter, $allow); + $this->policies[] = $policy; + return $policy; + } + + public function allow(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = []): void { + $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, true); + } + + public function deny(string $url, string $method, array $queryFilter = [], array $postFilter = []): void { + $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, false); + } + + private function validateJWT(): void { + if (!isset($this->accountSid) || \strpos($this->accountSid, 'AC') !== 0) { + throw new \Exception('Invalid AccountSid provided: ' . $this->accountSid); + } + if (!isset($this->workspaceSid) || \strpos($this->workspaceSid, 'WS') !== 0) { + 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(): void { + $method = 'GET'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function allowUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowUpdatesSubresources(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function allowDelete(): void { + $method = 'DELETE'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowDeleteSubresources(): void { + $method = 'DELETE'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function generateToken(int $ttl = 3600, array $extraAttributes = []): string { + $payload = [ + '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 (\strpos($this->channelId, 'WK') === 0) { + $payload['worker_sid'] = $this->channelId; + } else if (\strpos($this->channelId, 'WQ') === 0) { + $payload['taskqueue_sid'] = $this->channelId; + } + + foreach ($extraAttributes as $key => $value) { + $payload[$key] = $value; + } + + $policyStrings = []; + foreach ($this->policies as $policy) { + $policyStrings[] = $policy->toArray(); + } + + $payload['policies'] = $policyStrings; + return JWT::encode($payload, $this->authToken, 'HS256'); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/Policy.php b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/Policy.php new file mode 100644 index 0000000..2e41dfd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/Policy.php @@ -0,0 +1,54 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class Policy { + private $url; + private $method; + private $queryFilter; + private $postFilter; + private $allow; + + public function __construct(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true) { + $this->url = $url; + $this->method = $method; + $this->queryFilter = $queryFilter; + $this->postFilter = $postFilter; + $this->allow = $allow; + } + + public function addQueryFilter($queryFilter): void { + $this->queryFilter[] = $queryFilter; + } + + public function addPostFilter($postFilter): void { + $this->postFilter[] = $postFilter; + } + + public function toArray(): array { + $policy_array = ['url' => $this->url, 'method' => $this->method, 'allow' => $this->allow]; + if ($this->queryFilter !== null) { + if (\count($this->queryFilter) > 0) { + $policy_array['query_filter'] = $this->queryFilter; + } else { + $policy_array['query_filter'] = new \stdClass(); + } + } + if ($this->postFilter !== null) { + if (\count($this->postFilter) > 0) { + $policy_array['post_filter'] = $this->postFilter; + } else { + $policy_array['post_filter'] = new \stdClass(); + } + } + return $policy_array; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/TaskQueueCapability.php b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/TaskQueueCapability.php new file mode 100644 index 0000000..51ca2d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/TaskQueueCapability.php @@ -0,0 +1,21 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class TaskQueueCapability extends CapabilityToken { + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $taskQueueSid, + string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { + parent::__construct($accountSid, $authToken, $workspaceSid, $taskQueueSid, null, $overrideBaseUrl, $overrideBaseWSUrl); + } + + protected function setupResource(): void { + $this->resourceUrl = $this->baseUrl . '/TaskQueues/' . $this->channelId; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkerCapability.php b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkerCapability.php new file mode 100644 index 0000000..2bde217 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkerCapability.php @@ -0,0 +1,49 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkerCapability extends CapabilityToken { + private $tasksUrl; + private $workerReservationsUrl; + private $activityUrl; + + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $workerSid, + string $overrideBaseUrl = null, string $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(): void { + $this->resourceUrl = $this->baseUrl . '/Workers/' . $this->channelId; + } + + public function allowActivityUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = ['ActivitySid' => $this->required]; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowReservationUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->tasksUrl, $method, $queryFilter, $postFilter); + $this->allow($this->workerReservationsUrl, $method, $queryFilter, $postFilter); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkspaceCapability.php b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkspaceCapability.php new file mode 100644 index 0000000..c644ec1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Jwt/TaskRouter/WorkspaceCapability.php @@ -0,0 +1,16 @@ +resourceUrl = $this->baseUrl; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/ListResource.php b/vendor/twilio/sdk/src/Twilio/ListResource.php new file mode 100644 index 0000000..889f208 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/ListResource.php @@ -0,0 +1,19 @@ +version = $version; + } + + public function __toString(): string { + return '[ListResource]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Options.php b/vendor/twilio/sdk/src/Twilio/Options.php new file mode 100644 index 0000000..ac262b1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Options.php @@ -0,0 +1,13 @@ +options); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Page.php b/vendor/twilio/sdk/src/Twilio/Page.php new file mode 100644 index 0000000..df59add --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Page.php @@ -0,0 +1,195 @@ +processResponse($response); + + $this->version = $version; + $this->payload = $payload; + $this->solution = []; + $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(); + $details = []; + $moreInfo = ''; + + if (\is_array($content)) { + $message .= isset($content['message']) ? ': ' . $content['message'] : ''; + $code = $content['code'] ?? $code; + $moreInfo = $content['more_info'] ?? ''; + $details = $content['details'] ?? [] ; + } + + throw new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); + } + return $response->getContent(); + } + + protected function isPagingEol(?array $content): bool { + return $content !== null && \array_key_exists('code', $content) && $content['code'] === 20006; + } + + protected function hasMeta(string $key): bool { + return \array_key_exists('meta', $this->payload) && \array_key_exists($key, $this->payload['meta']); + } + + protected function getMeta(string $key, string $default = null): ?string { + return $this->hasMeta($key) ? $this->payload['meta'][$key] : $default; + } + + protected function loadPage(): array { + $key = $this->getMeta('key'); + if ($key) { + return $this->payload[$key]; + } + + $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 []; + } + + throw new DeserializeException('Page Records can not be deserialized'); + } + + public function getPreviousPageUrl(): ?string { + 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(): ?string { + 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(): ?Page { + 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(): ?Page { + 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)
+ * Return the current element + * @link http://php.net/manual/en/iterator.current.php + * @return mixed Can return any type. + */ + #[\ReturnTypeWillChange] + public function current() { + return $this->buildInstance($this->records->current()); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Move forward to next element + * @link http://php.net/manual/en/iterator.next.php + * @return void Any returned value is ignored. + */ + public function next(): void { + $this->records->next(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * 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. + */ + #[\ReturnTypeWillChange] + public function key() { + return $this->records->key(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid + * @link http://php.net/manual/en/iterator.valid.php + * @return bool The return value will be casted to boolean and then evaluated. + * Returns true on success or false on failure. + */ + public function valid(): bool { + return $this->records->valid(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * 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(): void { + $this->records->rewind(); + } + + + public function getVersion(): Version { + return $this->version; + } + + public function __toString(): string { + return '[Page]'; + } + +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts.php new file mode 100644 index 0000000..9d76551 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts.php @@ -0,0 +1,47 @@ +authTokenPromotion instead + */ + protected function getAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionList { + echo "authTokenPromotion is deprecated. Use v1->authTokenPromotion instead."; + return $this->v1->authTokenPromotion; + } + + /** + * @deprecated Use v1->authTokenPromotion() instead. + */ + protected function contextAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext { + echo "authTokenPromotion() is deprecated. Use v1->authTokenPromotion() instead."; + return $this->v1->authTokenPromotion(); + } + + /** + * @deprecated Use v1->credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Accounts\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->secondaryAuthToken instead. + */ + protected function getSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList { + echo "secondaryAuthToken is deprecated. Use v1->secondaryAuthToken instead."; + return $this->v1->secondaryAuthToken; + } + + /** + * @deprecated Use v1->secondaryAuthToken() instead. + */ + protected function contextSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext { + echo "secondaryAuthToken() is deprecated. Use v1->secondaryAuthToken() instead."; + return $this->v1->secondaryAuthToken(); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1.php new file mode 100644 index 0000000..f605f84 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1.php @@ -0,0 +1,127 @@ +version = 'v1'; + } + + protected function getAuthTokenPromotion(): AuthTokenPromotionList + { + if (!$this->_authTokenPromotion) { + $this->_authTokenPromotion = new AuthTokenPromotionList($this); + } + return $this->_authTokenPromotion; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getSafelist(): SafelistList + { + if (!$this->_safelist) { + $this->_safelist = new SafelistList($this); + } + return $this->_safelist; + } + + protected function getSecondaryAuthToken(): SecondaryAuthTokenList + { + if (!$this->_secondaryAuthToken) { + $this->_secondaryAuthToken = new SecondaryAuthTokenList($this); + } + return $this->_secondaryAuthToken; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Accounts.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php new file mode 100644 index 0000000..1f1c9dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/AuthTokens/Promote'; + } + + /** + * Update the AuthTokenPromotionInstance + * + * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AuthTokenPromotionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new AuthTokenPromotionInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AuthTokenPromotionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php new file mode 100644 index 0000000..e312737 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php @@ -0,0 +1,122 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + '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')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthTokenPromotionContext Context for this AuthTokenPromotionInstance + */ + protected function proxy(): AuthTokenPromotionContext + { + if (!$this->context) { + $this->context = new AuthTokenPromotionContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Update the AuthTokenPromotionInstance + * + * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AuthTokenPromotionInstance + { + + return $this->proxy()->update(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AuthTokenPromotionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php new file mode 100644 index 0000000..14eae45 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a AuthTokenPromotionContext + */ + public function getContext( + + ): AuthTokenPromotionContext + { + return new AuthTokenPromotionContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AuthTokenPromotionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php new file mode 100644 index 0000000..b9c04fc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTokenPromotionInstance \Twilio\Rest\Accounts\V1\AuthTokenPromotionInstance + */ + public function buildInstance(array $payload): AuthTokenPromotionInstance + { + return new AuthTokenPromotionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AuthTokenPromotionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php new file mode 100644 index 0000000..ae408f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AwsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AwsInstance + * + * @return AwsInstance Fetched AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AwsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AwsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AwsInstance + * + * @param array|Options $options Optional Arguments + * @return AwsInstance Updated AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AwsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AwsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AwsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php new file mode 100644 index 0000000..747cc65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php @@ -0,0 +1,152 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AwsContext Context for this AwsInstance + */ + protected function proxy(): AwsContext + { + if (!$this->context) { + $this->context = new AwsContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AwsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AwsInstance + * + * @return AwsInstance Fetched AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AwsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AwsInstance + * + * @param array|Options $options Optional Arguments + * @return AwsInstance Updated AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AwsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php new file mode 100644 index 0000000..66ccc8b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php @@ -0,0 +1,195 @@ +solution = [ + ]; + + $this->uri = '/Credentials/AWS'; + } + + /** + * Create the AwsInstance + * + * @param string $credentials A string that contains the AWS access credentials in the format `:`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` + * @param array|Options $options Optional Arguments + * @return AwsInstance Created AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentials, array $options = []): AwsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Credentials' => + $credentials, + 'FriendlyName' => + $options['friendlyName'], + 'AccountSid' => + $options['accountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AwsInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AwsPage Page of AwsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AwsPage + { + + $params = Values::of([ + '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 AwsPage Page of AwsInstance + */ + public function getPage(string $targetUrl): AwsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AwsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AwsContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. + */ + public function getContext( + string $sid + + ): AwsContext + { + return new AwsContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AwsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php new file mode 100644 index 0000000..124df1b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['accountSid'] = $accountSid; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. + * + * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.CreateAwsOptions ' . $options . ']'; + } +} + + + + +class UpdateAwsOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.UpdateAwsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php new file mode 100644 index 0000000..a9d5c92 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AwsInstance \Twilio\Rest\Accounts\V1\Credential\AwsInstance + */ + public function buildInstance(array $payload): AwsInstance + { + return new AwsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AwsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php new file mode 100644 index 0000000..9585d1d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PublicKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PublicKeyInstance + * + * @return PublicKeyInstance Fetched PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublicKeyInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PublicKeyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the PublicKeyInstance + * + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Updated PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PublicKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new PublicKeyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.PublicKeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php new file mode 100644 index 0000000..b1ba700 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php @@ -0,0 +1,152 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PublicKeyContext Context for this PublicKeyInstance + */ + protected function proxy(): PublicKeyContext + { + if (!$this->context) { + $this->context = new PublicKeyContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PublicKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PublicKeyInstance + * + * @return PublicKeyInstance Fetched PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublicKeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PublicKeyInstance + * + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Updated PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PublicKeyInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php new file mode 100644 index 0000000..448e637 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php @@ -0,0 +1,195 @@ +solution = [ + ]; + + $this->uri = '/Credentials/PublicKeys'; + } + + /** + * Create the PublicKeyInstance + * + * @param string $publicKey A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----` + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Created PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $publicKey, array $options = []): PublicKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PublicKey' => + $publicKey, + 'FriendlyName' => + $options['friendlyName'], + 'AccountSid' => + $options['accountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PublicKeyInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PublicKeyPage Page of PublicKeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PublicKeyPage + { + + $params = Values::of([ + '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 PublicKeyPage Page of PublicKeyInstance + */ + public function getPage(string $targetUrl): PublicKeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PublicKeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PublicKeyContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. + */ + public function getContext( + string $sid + + ): PublicKeyContext + { + return new PublicKeyContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.PublicKeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php new file mode 100644 index 0000000..c021fd6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['accountSid'] = $accountSid; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request + * + * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.CreatePublicKeyOptions ' . $options . ']'; + } +} + + + + +class UpdatePublicKeyOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.UpdatePublicKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php new file mode 100644 index 0000000..767a5d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PublicKeyInstance \Twilio\Rest\Accounts\V1\Credential\PublicKeyInstance + */ + public function buildInstance(array $payload): PublicKeyInstance + { + return new PublicKeyInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.PublicKeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php new file mode 100644 index 0000000..54e5832 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.CredentialInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php new file mode 100644 index 0000000..262c264 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the aws + */ + protected function getAws(): AwsList + { + if (!$this->_aws) { + $this->_aws = new AwsList( + $this->version + ); + } + return $this->_aws; + } + + /** + * Access the publicKey + */ + protected function getPublicKey(): PublicKeyList + { + if (!$this->_publicKey) { + $this->_publicKey = new PublicKeyList( + $this->version + ); + } + return $this->_publicKey; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Accounts.V1.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php new file mode 100644 index 0000000..f53f6d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Accounts\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistInstance.php new file mode 100644 index 0000000..143d608 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SafelistInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistList.php new file mode 100644 index 0000000..d5d3b37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistList.php @@ -0,0 +1,128 @@ +solution = [ + ]; + + $this->uri = '/SafeList/Numbers'; + } + + /** + * Create the SafelistInstance + * + * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return SafelistInstance Created SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber): SafelistInstance + { + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SafelistInstance( + $this->version, + $payload + ); + } + + + /** + * Delete the SafelistInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $params = Values::of([ + 'PhoneNumber' => + $options['phoneNumber'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, $params, [], $headers); + } + + + /** + * Fetch the SafelistInstance + * + * @param array|Options $options Optional Arguments + * @return SafelistInstance Fetched SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): SafelistInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'PhoneNumber' => + $options['phoneNumber'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new SafelistInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SafelistList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistOptions.php new file mode 100644 index 0000000..bad0609 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistOptions.php @@ -0,0 +1,130 @@ +options['phoneNumber'] = $phoneNumber; + } + + /** + * The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * + * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.DeleteSafelistOptions ' . $options . ']'; + } +} + +class FetchSafelistOptions extends Options + { + /** + * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + */ + public function __construct( + + string $phoneNumber = Values::NONE + + ) { + $this->options['phoneNumber'] = $phoneNumber; + } + + /** + * The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * + * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.FetchSafelistOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistPage.php new file mode 100644 index 0000000..47bb782 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SafelistPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SafelistInstance \Twilio\Rest\Accounts\V1\SafelistInstance + */ + public function buildInstance(array $payload): SafelistInstance + { + return new SafelistInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SafelistPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php new file mode 100644 index 0000000..fa2d3f0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php @@ -0,0 +1,91 @@ +solution = [ + ]; + + $this->uri = '/AuthTokens/Secondary'; + } + + /** + * Create the SecondaryAuthTokenInstance + * + * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SecondaryAuthTokenInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new SecondaryAuthTokenInstance( + $this->version, + $payload + ); + } + + + /** + * Delete the SecondaryAuthTokenInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.SecondaryAuthTokenContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php new file mode 100644 index 0000000..819e98e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php @@ -0,0 +1,134 @@ +properties = [ + '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')), + 'secondaryAuthToken' => Values::array_get($payload, 'secondary_auth_token'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SecondaryAuthTokenContext Context for this SecondaryAuthTokenInstance + */ + protected function proxy(): SecondaryAuthTokenContext + { + if (!$this->context) { + $this->context = new SecondaryAuthTokenContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the SecondaryAuthTokenInstance + * + * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SecondaryAuthTokenInstance + { + + return $this->proxy()->create(); + } + + /** + * Delete the SecondaryAuthTokenInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.SecondaryAuthTokenInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php new file mode 100644 index 0000000..c72ddf4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SecondaryAuthTokenContext + */ + public function getContext( + + ): SecondaryAuthTokenContext + { + return new SecondaryAuthTokenContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SecondaryAuthTokenList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php new file mode 100644 index 0000000..0db1a14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SecondaryAuthTokenInstance \Twilio\Rest\Accounts\V1\SecondaryAuthTokenInstance + */ + public function buildInstance(array $payload): SecondaryAuthTokenInstance + { + return new SecondaryAuthTokenInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SecondaryAuthTokenPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/AccountsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/AccountsBase.php new file mode 100644 index 0000000..794cb4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/AccountsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://accounts.twilio.com'; + } + + + /** + * @return V1 Version v1 of accounts + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Accounts]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api.php b/vendor/twilio/sdk/src/Twilio/Rest/Api.php new file mode 100644 index 0000000..d5300b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api.php @@ -0,0 +1,371 @@ +v2010->account; + } + + protected function getAccounts(): \Twilio\Rest\Api\V2010\AccountList { + return $this->v2010->accounts; + } + + /** + * @param string $sid Fetch by unique Account Sid + */ + protected function contextAccounts(string $sid): \Twilio\Rest\Api\V2010\AccountContext { + return $this->v2010->accounts($sid); + } + + /** + * @deprecated Use account->addresses instead. + */ + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { + echo "addresses is deprecated. Use account->addresses instead."; + return $this->v2010->account->addresses; + } + + /** + * @deprecated Use account->addresses(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { + echo "addresses(\$sid) is deprecated. Use account->addresses(\$sid) instead."; + return $this->v2010->account->addresses($sid); + } + + /** + * @deprecated Use account->applications instead. + */ + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { + echo "applications is deprecated. Use account->applications instead."; + return $this->v2010->account->applications; + } + + /** + * @deprecated Use account->applications(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { + echo "applications(\$sid) is deprecated. Use account->applications(\$sid) instead."; + return $this->v2010->account->applications($sid); + } + + /** + * @deprecated Use account->authorizedConnectApps instead. + */ + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { + echo "authorizedConnectApps is deprecated. Use account->authorizedConnectApps instead."; + return $this->v2010->account->authorizedConnectApps; + } + + /** + * @deprecated Use account->authorizedConnectApps(\$connectAppSid) instead. + * @param string $connectAppSid The SID of the Connect App to fetch + */ + protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { + echo "authorizedConnectApps(\$connectAppSid) is deprecated. Use account->authorizedConnectApps(\$connectAppSid) instead."; + return $this->v2010->account->authorizedConnectApps($connectAppSid); + } + + /** + * @deprecated Use account->availablePhoneNumbers instead. + */ + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { + echo "availablePhoneNumbers is deprecated. Use account->availablePhoneNumbers instead."; + return $this->v2010->account->availablePhoneNumbers; + } + + /** + * @deprecated Use account->availablePhoneNumbers(\$countryCode) instead. + * @param string $countryCode The ISO country code of the country to fetch + * available phone number information about + */ + protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { + echo "availablePhoneNumbers(\$countryCode) is deprecated. Use account->availablePhoneNumbers(\$countryCode) instead."; + return $this->v2010->account->availablePhoneNumbers($countryCode); + } + + /** + * @deprecated Use account->balance instead. + */ + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { + echo "balance is deprecated. Use account->balance instead."; + return $this->v2010->account->balance; + } + + /** + * @deprecated Use account->calls instead + */ + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { + echo "calls is deprecated. Use account->calls instead."; + return $this->v2010->account->calls; + } + + /** + * @deprecated Use account->calls(\$sid) instead. + * @param string $sid The SID of the Call resource to fetch + */ + protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { + echo "calls(\$sid) is deprecated. Use account->calls(\$sid) instead."; + return $this->v2010->account->calls($sid); + } + + /** + * @deprecated Use account->conferences instead. + */ + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { + echo "conferences is deprecated. Use account->conferences instead."; + return $this->v2010->account->conferences; + } + + /** + * @deprecated Use account->conferences(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { + echo "conferences(\$sid) is deprecated. Use account->conferences(\$sid) instead."; + return $this->v2010->account->conferences($sid); + } + + /** + * @deprecated Use account->connectApps instead. + */ + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { + echo "connectApps is deprecated. Use account->connectApps instead."; + return $this->v2010->account->connectApps; + } + + /** + * @deprecated account->connectApps(\$sid) + * @param string $sid The unique string that identifies the resource + */ + protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { + echo "connectApps(\$sid) is deprecated. Use account->connectApps(\$sid) instead."; + return $this->v2010->account->connectApps($sid); + } + + /** + * @deprecated Use account->incomingPhoneNumbers instead + */ + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { + echo "incomingPhoneNumbers is deprecated. Use account->incomingPhoneNumbers instead."; + return $this->v2010->account->incomingPhoneNumbers; + } + + /** + * @deprecated Use account->incomingPhoneNumbers(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { + echo "incomingPhoneNumbers(\$sid) is deprecated. Use account->incomingPhoneNumbers(\$sid) instead."; + return $this->v2010->account->incomingPhoneNumbers($sid); + } + + /** + * @deprecated Use account->keys instead. + */ + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { + echo "keys is deprecated. Use account->keys instead."; + return $this->v2010->account->keys; + } + + /** + * @deprecated Use account->keys(\$sid) instead + * @param string $sid The unique string that identifies the resource + */ + protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { + echo "keys(\$sid) is deprecated. Use account->keys(\$sid) instead."; + return $this->v2010->account->keys($sid); + } + + /** + * @deprecated Use account->messages instead. + */ + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { + echo "messages is deprecated. Use account->messages instead."; + return $this->v2010->account->messages; + } + + /** + * @deprecated Use account->messages(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { + echo "amessages(\$sid) is deprecated. Use account->messages(\$sid) instead."; + return $this->v2010->account->messages($sid); + } + + /** + * @deprecated Use account->newKeys instead. + */ + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { + echo "newKeys is deprecated. Use account->newKeys instead."; + return $this->v2010->account->newKeys; + } + + /** + * @deprecated Use account->newSigningKeys instead. + */ + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { + echo "newSigningKeys is deprecated. Use account->newSigningKeys instead."; + return $this->v2010->account->newSigningKeys; + } + + /** + * @deprecated Use account->notifications instead. + */ + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { + echo "notifications is deprecated. Use account->notifications instead."; + return $this->v2010->account->notifications; + } + + /** + * @deprecated Use account->notifications(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { + echo "notifications(\$sid) is deprecated. Use account->notifications(\$sid) instead."; + return $this->v2010->account->notifications($sid); + } + + /** + * @deprecated Use account->outgoingCallerIds instead. + */ + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { + echo "outgoingCallerIds is deprecated. Use account->outgoingCallerIds instead."; + return $this->v2010->account->outgoingCallerIds; + } + + /** + * @deprecated Use account->outgoingCallerIds(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { + echo "outgoingCallerIds(\$sid) is deprecated. Use account->outgoingCallerIds(\$sid) instead."; + return $this->v2010->account->outgoingCallerIds($sid); + } + + /** + * @deprecated Use account->queues instead. + */ + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { + echo "queues is deprecated. Use account->queues instead."; + return $this->v2010->account->queues; + } + + /** + * @deprecated Use account->queues(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { + echo "queues(\$sid) is deprecated. Use account->queues(\$sid) instead."; + return $this->v2010->account->queues($sid); + } + + /** + * @deprecated Use account->recordings instead. + */ + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { + echo "recordings is deprecated. Use account->recordings instead."; + return $this->v2010->account->recordings; + } + + /** + * @deprecated Use account->recordings(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { + echo "recordings(\$sid) is deprecated. Use account->recordings(\$sid) instead."; + return $this->v2010->account->recordings($sid); + } + + /** + * @deprecated Use account->signingKeys instead. + */ + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { + echo "signingKeys is deprecated. Use account->signingKeys instead."; + return $this->v2010->account->signingKeys; + } + + /** + * @deprecated Use account->signingKeys(\$sid) instead. + * @param string $sid The sid + */ + protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { + echo "signingKeys(\$sid) is deprecated. Use account->signingKeys(\$sid) instead."; + return $this->v2010->account->signingKeys($sid); + } + + /** + * @deprecated Use account->sip instead. + */ + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { + echo "sip is deprecated. Use account->sip instead."; + return $this->v2010->account->sip; + } + + /** + * @deprecated Use account->shortCodes instead. + */ + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { + echo "shortCodes is deprecated. Use account->shortCodes instead."; + return $this->v2010->account->shortCodes; + } + + /** + * @deprecated Use account->shortCodes(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { + echo "shortCodes(\$sid) is deprecated. Use account->shortCodes(\$sid) instead."; + return $this->v2010->account->shortCodes($sid); + } + + /** + * @deprecated Use account->token instead. + */ + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { + echo "tokens is deprecated. Use account->token instead."; + return $this->v2010->account->tokens; + } + + /** + * @deprecated Use account->transcriptions instead. + */ + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { + echo "transcriptions is deprecated. Use account->transcriptions instead."; + return $this->v2010->account->transcriptions; + } + + /** + * @deprecated Use account->transcriptions(\$sid) instead + * @param string $sid The unique string that identifies the resource + */ + protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { + echo "transcriptions(\$sid) is deprecated. Use account->transcriptions(\$sid) instead."; + return $this->v2010->account->transcriptions($sid); + } + + /** + * @deprecated Use account->usage instead. + */ + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { + echo "usage is deprecated. Use account->usage instead."; + return $this->v2010->account->usage; + } + + /** + * @deprecated Use account->validationRequests instead. + */ + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { + echo "validationRequests is deprecated. Use account->validationRequests instead."; + return $this->v2010->account->validationRequests; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010.php new file mode 100644 index 0000000..a600400 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010.php @@ -0,0 +1,309 @@ +version = '2010-04-01'; + } + + protected function getAccounts(): AccountList + { + if (!$this->_accounts) { + $this->_accounts = new AccountList($this); + } + return $this->_accounts; + } + + /** + * @return AccountContext Account provided as the authenticating account + */ + protected function getAccount(): AccountContext + { + 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): void + { + $this->_account = $account; + } + + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList + { + return $this->account->recordings; + } + + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList + { + return $this->account->usage; + } + + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList + { + return $this->account->messages; + } + + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList + { + return $this->account->keys; + } + + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList + { + return $this->account->newKeys; + } + + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList + { + return $this->account->applications; + } + + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList + { + return $this->account->incomingPhoneNumbers; + } + + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList + { + return $this->account->conferences; + } + + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList + { + return $this->account->calls; + } + + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList + { + return $this->account->outgoingCallerIds; + } + + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList + { + return $this->account->validationRequests; + } + + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList + { + return $this->account->transcriptions; + } + + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList + { + return $this->account->connectApps; + } + + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList + { + return $this->account->authorizedConnectApps; + } + + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList + { + return $this->account->tokens; + } + + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList + { + return $this->account->balance; + } + + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList + { + return $this->account->sip; + } + + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList + { + return $this->account->notifications; + } + + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList + { + return $this->account->availablePhoneNumbers; + } + + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList + { + return $this->account->addresses; + } + + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList + { + return $this->account->queues; + } + + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList + { + return $this->account->shortCodes; + } + + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList + { + return $this->account->signingKeys; + } + + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList + { + return $this->account->newSigningKeys; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php new file mode 100644 index 0000000..d8aa82e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php @@ -0,0 +1,133 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php new file mode 100644 index 0000000..9640764 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php @@ -0,0 +1,157 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'addressSid' => + $addressSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses/' . \rawurlencode($addressSid) + .'/DependentPhoneNumbers.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DependentPhoneNumberPage Page of DependentPhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DependentPhoneNumberPage + { + + $params = Values::of([ + '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 DependentPhoneNumberPage Page of DependentPhoneNumberInstance + */ + public function getPage(string $targetUrl): DependentPhoneNumberPage + { + $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(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php new file mode 100644 index 0000000..fb94a43 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DependentPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberInstance + */ + public function buildInstance(array $payload): DependentPhoneNumberInstance + { + return new DependentPhoneNumberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['addressSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php new file mode 100644 index 0000000..52ed5c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php @@ -0,0 +1,208 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AddressInstance + * + * @return AddressInstance Fetched AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the AddressInstance + * + * @param array|Options $options Optional Arguments + * @return AddressInstance Updated AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + 'StreetSecondary' => + $options['streetSecondary'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the dependentPhoneNumbers + */ + protected function getDependentPhoneNumbers(): DependentPhoneNumberList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddressContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php new file mode 100644 index 0000000..fb52dbf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php @@ -0,0 +1,185 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'city' => Values::array_get($payload, 'city'), + 'customerName' => Values::array_get($payload, 'customer_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'region' => Values::array_get($payload, 'region'), + 'sid' => Values::array_get($payload, 'sid'), + 'street' => Values::array_get($payload, 'street'), + 'uri' => Values::array_get($payload, 'uri'), + 'emergencyEnabled' => Values::array_get($payload, 'emergency_enabled'), + 'validated' => Values::array_get($payload, 'validated'), + 'verified' => Values::array_get($payload, 'verified'), + 'streetSecondary' => Values::array_get($payload, 'street_secondary'), + ]; + + $this->solution = ['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 AddressContext Context for this AddressInstance + */ + protected function proxy(): AddressContext + { + if (!$this->context) { + $this->context = new AddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddressInstance + * + * @return AddressInstance Fetched AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AddressInstance + * + * @param array|Options $options Optional Arguments + * @return AddressInstance Updated AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dependentPhoneNumbers + */ + protected function getDependentPhoneNumbers(): DependentPhoneNumberList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddressInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php new file mode 100644 index 0000000..a85f000 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php @@ -0,0 +1,233 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses.json'; + } + + /** + * Create the AddressInstance + * + * @param string $customerName The name to associate with the new address. + * @param string $street The number and street address of the new address. + * @param string $city The city of the new address. + * @param string $region The state or region of the new address. + * @param string $postalCode The postal code of the new address. + * @param string $isoCountry The ISO country code of the new address. + * @param array|Options $options Optional Arguments + * @return AddressInstance Created AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $customerName, string $street, string $city, string $region, string $postalCode, string $isoCountry, array $options = []): AddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + 'StreetSecondary' => + $options['streetSecondary'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AddressInstance 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 AddressPage Page of AddressInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddressPage + { + $options = new Values($options); + + $params = Values::of([ + '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 AddressPage Page of AddressInstance + */ + public function getPage(string $targetUrl): AddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddressPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddressContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. + */ + public function getContext( + string $sid + + ): AddressContext + { + return new AddressContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddressList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php new file mode 100644 index 0000000..dd27480 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php @@ -0,0 +1,418 @@ +options['friendlyName'] = $friendlyName; + $this->options['emergencyEnabled'] = $emergencyEnabled; + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + $this->options['streetSecondary'] = $streetSecondary; + } + + /** + * A descriptive string that you create to describe the new address. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to enable emergency calling on the new address. Can be: `true` or `false`. + * + * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setEmergencyEnabled(bool $emergencyEnabled): self + { + $this->options['emergencyEnabled'] = $emergencyEnabled; + return $this; + } + + /** + * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @return $this Fluent Builder + */ + public function setAutoCorrectAddress(bool $autoCorrectAddress): self + { + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + return $this; + } + + /** + * The additional number and street address of the address. + * + * @param string $streetSecondary The additional number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreetSecondary(string $streetSecondary): self + { + $this->options['streetSecondary'] = $streetSecondary; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateAddressOptions ' . $options . ']'; + } +} + + + +class ReadAddressOptions extends Options + { + /** + * @param string $customerName The `customer_name` of the Address resources to read. + * @param string $friendlyName The string that identifies the Address resources to read. + * @param string $isoCountry The ISO country code of the Address resources to read. + */ + public function __construct( + + string $customerName = Values::NONE, + string $friendlyName = Values::NONE, + string $isoCountry = Values::NONE + + ) { + $this->options['customerName'] = $customerName; + $this->options['friendlyName'] = $friendlyName; + $this->options['isoCountry'] = $isoCountry; + } + + /** + * The `customer_name` of the Address resources to read. + * + * @param string $customerName The `customer_name` of the Address resources to read. + * @return $this Fluent Builder + */ + public function setCustomerName(string $customerName): self + { + $this->options['customerName'] = $customerName; + return $this; + } + + /** + * The string that identifies the Address resources to read. + * + * @param string $friendlyName The string that identifies the Address resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The ISO country code of the Address resources to read. + * + * @param string $isoCountry The ISO country code of the Address resources to read. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAddressOptions ' . $options . ']'; + } +} + +class UpdateAddressOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. + * @param string $customerName The name to associate with the address. + * @param string $street The number and street address of the address. + * @param string $city The city of the address. + * @param string $region The state or region of the address. + * @param string $postalCode The postal code of the address. + * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @param string $streetSecondary The additional number and street address of the address. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $customerName = Values::NONE, + string $street = Values::NONE, + string $city = Values::NONE, + string $region = Values::NONE, + string $postalCode = Values::NONE, + bool $emergencyEnabled = Values::BOOL_NONE, + bool $autoCorrectAddress = Values::BOOL_NONE, + string $streetSecondary = 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; + $this->options['streetSecondary'] = $streetSecondary; + } + + /** + * A descriptive string that you create to describe the address. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The name to associate with the address. + * + * @param string $customerName The name to associate with the address. + * @return $this Fluent Builder + */ + public function setCustomerName(string $customerName): self + { + $this->options['customerName'] = $customerName; + return $this; + } + + /** + * The number and street address of the address. + * + * @param string $street The number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreet(string $street): self + { + $this->options['street'] = $street; + return $this; + } + + /** + * The city of the address. + * + * @param string $city The city of the address. + * @return $this Fluent Builder + */ + public function setCity(string $city): self + { + $this->options['city'] = $city; + return $this; + } + + /** + * The state or region of the address. + * + * @param string $region The state or region of the address. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The postal code of the address. + * + * @param string $postalCode The postal code of the address. + * @return $this Fluent Builder + */ + public function setPostalCode(string $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * Whether to enable emergency calling on the address. Can be: `true` or `false`. + * + * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setEmergencyEnabled(bool $emergencyEnabled): self + { + $this->options['emergencyEnabled'] = $emergencyEnabled; + return $this; + } + + /** + * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @return $this Fluent Builder + */ + public function setAutoCorrectAddress(bool $autoCorrectAddress): self + { + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + return $this; + } + + /** + * The additional number and street address of the address. + * + * @param string $streetSecondary The additional number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreetSecondary(string $streetSecondary): self + { + $this->options['streetSecondary'] = $streetSecondary; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateAddressOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php new file mode 100644 index 0000000..050e7fd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddressInstance \Twilio\Rest\Api\V2010\Account\AddressInstance + */ + public function buildInstance(array $payload): AddressInstance + { + return new AddressInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddressPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php new file mode 100644 index 0000000..b911a24 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php @@ -0,0 +1,164 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Applications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the ApplicationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ApplicationInstance + * + * @return ApplicationInstance Fetched ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApplicationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Updated ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ApplicationInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + 'PublicApplicationConnectEnabled' => + Serialize::booleanToString($options['publicApplicationConnectEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php new file mode 100644 index 0000000..97cd3d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php @@ -0,0 +1,184 @@ +properties = [ + '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'), + 'publicApplicationConnectEnabled' => Values::array_get($payload, 'public_application_connect_enabled'), + ]; + + $this->solution = ['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 ApplicationContext Context for this ApplicationInstance + */ + protected function proxy(): ApplicationContext + { + if (!$this->context) { + $this->context = new ApplicationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ApplicationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ApplicationInstance + * + * @return ApplicationInstance Fetched ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApplicationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Updated ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ApplicationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ApplicationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php new file mode 100644 index 0000000..f5a1ed8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php @@ -0,0 +1,235 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Applications.json'; + } + + /** + * Create the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Created ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ApplicationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ApiVersion' => + $options['apiVersion'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsStatusCallback' => + $options['smsStatusCallback'], + 'MessageStatusCallback' => + $options['messageStatusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'PublicApplicationConnectEnabled' => + Serialize::booleanToString($options['publicApplicationConnectEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ApplicationInstance 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 ApplicationPage Page of ApplicationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ApplicationPage + { + $options = new Values($options); + + $params = Values::of([ + '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 ApplicationPage Page of ApplicationInstance + */ + public function getPage(string $targetUrl): ApplicationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ApplicationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ApplicationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. + */ + public function getContext( + string $sid + + ): ApplicationContext + { + return new ApplicationContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ApplicationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php new file mode 100644 index 0000000..27418a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php @@ -0,0 +1,724 @@ +options['apiVersion'] = $apiVersion; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsStatusCallback'] = $smsStatusCallback; + $this->options['messageStatusCallback'] = $messageStatusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when the phone number assigned to this application receives a call. + * + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL we should call using a POST method to send status information about SMS messages sent by the application. + * + * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. + * @return $this Fluent Builder + */ + public function setSmsStatusCallback(string $smsStatusCallback): self + { + $this->options['smsStatusCallback'] = $smsStatusCallback; + return $this; + } + + /** + * The URL we should call using a POST method to send message status information to your application. + * + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @return $this Fluent Builder + */ + public function setMessageStatusCallback(string $messageStatusCallback): self + { + $this->options['messageStatusCallback'] = $messageStatusCallback; + return $this; + } + + /** + * A descriptive string that you create to describe the new application. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self + { + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateApplicationOptions ' . $options . ']'; + } +} + + + +class ReadApplicationOptions extends Options + { + /** + * @param string $friendlyName The string that identifies the Application resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The string that identifies the Application resources to read. + * + * @param string $friendlyName The string that identifies the Application resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadApplicationOptions ' . $options . ']'; + } +} + +class UpdateApplicationOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apiVersion = Values::NONE, + string $voiceUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + bool $voiceCallerIdLookup = Values::BOOL_NONE, + string $smsUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsStatusCallback = Values::NONE, + string $messageStatusCallback = Values::NONE, + bool $publicApplicationConnectEnabled = Values::BOOL_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; + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when the phone number assigned to this application receives a call. + * + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * + * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * @return $this Fluent Builder + */ + public function setSmsStatusCallback(string $smsStatusCallback): self + { + $this->options['smsStatusCallback'] = $smsStatusCallback; + return $this; + } + + /** + * The URL we should call using a POST method to send message status information to your application. + * + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @return $this Fluent Builder + */ + public function setMessageStatusCallback(string $messageStatusCallback): self + { + $this->options['messageStatusCallback'] = $messageStatusCallback; + return $this; + } + + /** + * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self + { + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateApplicationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php new file mode 100644 index 0000000..fe4b13c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApplicationInstance \Twilio\Rest\Api\V2010\Account\ApplicationInstance + */ + public function buildInstance(array $payload): ApplicationInstance + { + return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ApplicationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php new file mode 100644 index 0000000..d0540fb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php @@ -0,0 +1,89 @@ +solution = [ + 'accountSid' => + $accountSid, + 'connectAppSid' => + $connectAppSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AuthorizedConnectApps/' . \rawurlencode($connectAppSid) + .'.json'; + } + + /** + * Fetch the AuthorizedConnectAppInstance + * + * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizedConnectAppInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthorizedConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['connectAppSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthorizedConnectAppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php new file mode 100644 index 0000000..b18632f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php @@ -0,0 +1,131 @@ +properties = [ + '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'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 AuthorizedConnectAppContext Context for this AuthorizedConnectAppInstance + */ + protected function proxy(): AuthorizedConnectAppContext + { + if (!$this->context) { + $this->context = new AuthorizedConnectAppContext( + $this->version, + $this->solution['accountSid'], + $this->solution['connectAppSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AuthorizedConnectAppInstance + * + * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizedConnectAppInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthorizedConnectAppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php new file mode 100644 index 0000000..7d7be8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AuthorizedConnectApps.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthorizedConnectAppPage + { + + $params = Values::of([ + '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 AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance + */ + public function getPage(string $targetUrl): AuthorizedConnectAppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthorizedConnectAppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthorizedConnectAppContext + * + * @param string $connectAppSid The SID of the Connect App to fetch. + */ + public function getContext( + string $connectAppSid + + ): AuthorizedConnectAppContext + { + return new AuthorizedConnectAppContext( + $this->version, + $this->solution['accountSid'], + $connectAppSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthorizedConnectAppList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php new file mode 100644 index 0000000..622d993 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizedConnectAppInstance \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppInstance + */ + public function buildInstance(array $payload): AuthorizedConnectAppInstance + { + return new AuthorizedConnectAppInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthorizedConnectAppPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php new file mode 100644 index 0000000..747b497 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php new file mode 100644 index 0000000..4604bf0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Local.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LocalInstance 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 LocalPage Page of LocalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LocalPage + { + $options = new Values($options); + + $params = Values::of([ + '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 LocalPage Page of LocalInstance + */ + public function getPage(string $targetUrl): LocalPage + { + $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(): string + { + return '[Twilio.Api.V2010.LocalList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php new file mode 100644 index 0000000..29d9012 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php new file mode 100644 index 0000000..6949a3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LocalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalInstance + */ + public function buildInstance(array $payload): LocalInstance + { + return new LocalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php new file mode 100644 index 0000000..c6d1358 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MachineToMachineInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php new file mode 100644 index 0000000..b037096 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/MachineToMachine.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MachineToMachineInstance 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 MachineToMachinePage Page of MachineToMachineInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MachineToMachinePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MachineToMachinePage Page of MachineToMachineInstance + */ + public function getPage(string $targetUrl): MachineToMachinePage + { + $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(): string + { + return '[Twilio.Api.V2010.MachineToMachineList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php new file mode 100644 index 0000000..32188f2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMachineToMachineOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php new file mode 100644 index 0000000..4bbb72a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MachineToMachineInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance + */ + public function buildInstance(array $payload): MachineToMachineInstance + { + return new MachineToMachineInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MachineToMachinePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php new file mode 100644 index 0000000..ffc0d8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php new file mode 100644 index 0000000..505fb94 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Mobile.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MobileInstance 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 MobilePage Page of MobileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MobilePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MobilePage Page of MobileInstance + */ + public function getPage(string $targetUrl): MobilePage + { + $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(): string + { + return '[Twilio.Api.V2010.MobileList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php new file mode 100644 index 0000000..f67e929 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php new file mode 100644 index 0000000..6b6101e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MobileInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileInstance + */ + public function buildInstance(array $payload): MobileInstance + { + return new MobileInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobilePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php new file mode 100644 index 0000000..102f490 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NationalInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php new file mode 100644 index 0000000..75e0ca4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/National.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NationalInstance 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 NationalPage Page of NationalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NationalPage + { + $options = new Values($options); + + $params = Values::of([ + '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 NationalPage Page of NationalInstance + */ + public function getPage(string $targetUrl): NationalPage + { + $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(): string + { + return '[Twilio.Api.V2010.NationalList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php new file mode 100644 index 0000000..556069d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNationalOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php new file mode 100644 index 0000000..7c9cb66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NationalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalInstance + */ + public function buildInstance(array $payload): NationalInstance + { + return new NationalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NationalPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php new file mode 100644 index 0000000..b34b523 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SharedCostInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php new file mode 100644 index 0000000..e38ef87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/SharedCost.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SharedCostInstance 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 SharedCostPage Page of SharedCostInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SharedCostPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SharedCostPage Page of SharedCostInstance + */ + public function getPage(string $targetUrl): SharedCostPage + { + $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(): string + { + return '[Twilio.Api.V2010.SharedCostList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php new file mode 100644 index 0000000..98eaa2c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadSharedCostOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php new file mode 100644 index 0000000..7ece222 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SharedCostInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostInstance + */ + public function buildInstance(array $payload): SharedCostInstance + { + return new SharedCostInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SharedCostPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php new file mode 100644 index 0000000..a3a7f13 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php new file mode 100644 index 0000000..ca60fe5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/TollFree.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollFreeInstance 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 TollFreePage Page of TollFreeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollFreePage + { + $options = new Values($options); + + $params = Values::of([ + '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 TollFreePage Page of TollFreeInstance + */ + public function getPage(string $targetUrl): TollFreePage + { + $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(): string + { + return '[Twilio.Api.V2010.TollFreeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php new file mode 100644 index 0000000..004c193 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php new file mode 100644 index 0000000..9e48d66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeInstance + */ + public function buildInstance(array $payload): TollFreeInstance + { + return new TollFreeInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php new file mode 100644 index 0000000..920d2df --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php @@ -0,0 +1,108 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.VoipInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php new file mode 100644 index 0000000..a2fafe3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Voip.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VoipInstance 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 VoipPage Page of VoipInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VoipPage + { + $options = new Values($options); + + $params = Values::of([ + '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 VoipPage Page of VoipInstance + */ + public function getPage(string $targetUrl): VoipPage + { + $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(): string + { + return '[Twilio.Api.V2010.VoipList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php new file mode 100644 index 0000000..3a16d38 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadVoipOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php new file mode 100644 index 0000000..9c1c772 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoipInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipInstance + */ + public function buildInstance(array $payload): VoipInstance + { + return new VoipInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.VoipPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php new file mode 100644 index 0000000..6545b90 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php @@ -0,0 +1,261 @@ +solution = [ + 'accountSid' => + $accountSid, + 'countryCode' => + $countryCode, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'.json'; + } + + /** + * Fetch the AvailablePhoneNumberCountryInstance + * + * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailablePhoneNumberCountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AvailablePhoneNumberCountryInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + + /** + * Access the voip + */ + protected function getVoip(): VoipList + { + if (!$this->_voip) { + $this->_voip = new VoipList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_voip; + } + + /** + * Access the national + */ + protected function getNational(): NationalList + { + if (!$this->_national) { + $this->_national = new NationalList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_national; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + if (!$this->_mobile) { + $this->_mobile = new MobileList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_mobile; + } + + /** + * Access the machineToMachine + */ + protected function getMachineToMachine(): MachineToMachineList + { + if (!$this->_machineToMachine) { + $this->_machineToMachine = new MachineToMachineList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_machineToMachine; + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + if (!$this->_tollFree) { + $this->_tollFree = new TollFreeList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_tollFree; + } + + /** + * Access the sharedCost + */ + protected function getSharedCost(): SharedCostList + { + if (!$this->_sharedCost) { + $this->_sharedCost = new SharedCostList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_sharedCost; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + if (!$this->_local) { + $this->_local = new LocalList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_local; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php new file mode 100644 index 0000000..7015726 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php @@ -0,0 +1,196 @@ +properties = [ + '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 = ['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 AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance + */ + protected function proxy(): AvailablePhoneNumberCountryContext + { + if (!$this->context) { + $this->context = new AvailablePhoneNumberCountryContext( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailablePhoneNumberCountryInstance + * + * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailablePhoneNumberCountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the voip + */ + protected function getVoip(): VoipList + { + return $this->proxy()->voip; + } + + /** + * Access the national + */ + protected function getNational(): NationalList + { + return $this->proxy()->national; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + return $this->proxy()->mobile; + } + + /** + * Access the machineToMachine + */ + protected function getMachineToMachine(): MachineToMachineList + { + return $this->proxy()->machineToMachine; + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + return $this->proxy()->tollFree; + } + + /** + * Access the sharedCost + */ + protected function getSharedCost(): SharedCostList + { + return $this->proxy()->sharedCost; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + return $this->proxy()->local; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php new file mode 100644 index 0000000..74128c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailablePhoneNumberCountryPage + { + + $params = Values::of([ + '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 AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance + */ + public function getPage(string $targetUrl): AvailablePhoneNumberCountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailablePhoneNumberCountryContext + * + * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. + */ + public function getContext( + string $countryCode + + ): AvailablePhoneNumberCountryContext + { + return new AvailablePhoneNumberCountryContext( + $this->version, + $this->solution['accountSid'], + $countryCode + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php new file mode 100644 index 0000000..e67104e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailablePhoneNumberCountryInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryInstance + */ + public function buildInstance(array $payload): AvailablePhoneNumberCountryInstance + { + return new AvailablePhoneNumberCountryInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php new file mode 100644 index 0000000..d16e0d6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php @@ -0,0 +1,85 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'balance' => Values::array_get($payload, 'balance'), + 'currency' => Values::array_get($payload, 'currency'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalanceInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php new file mode 100644 index 0000000..6a3473d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php @@ -0,0 +1,79 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Balance.json'; + } + + /** + * Fetch the BalanceInstance + * + * @return BalanceInstance Fetched BalanceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BalanceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BalanceInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalanceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php new file mode 100644 index 0000000..23e2b1d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BalanceInstance \Twilio\Rest\Api\V2010\Account\BalanceInstance + */ + public function buildInstance(array $payload): BalanceInstance + { + return new BalanceInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalancePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php new file mode 100644 index 0000000..9099a2f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php @@ -0,0 +1,84 @@ +properties = [ + 'request' => Values::array_get($payload, 'request'), + 'response' => Values::array_get($payload, 'response'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php new file mode 100644 index 0000000..234049f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php @@ -0,0 +1,157 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Events.json'; + } + + /** + * 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 int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance 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 EventPage Page of EventInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + + $params = Values::of([ + '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 EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php new file mode 100644 index 0000000..08bb1b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Api\V2010\Account\Call\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php new file mode 100644 index 0000000..a651336 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php @@ -0,0 +1,95 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Notifications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php new file mode 100644 index 0000000..ddbf0f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'log' => Values::array_get($payload, 'log'), + 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), + 'messageText' => Values::array_get($payload, 'message_text'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php new file mode 100644 index 0000000..9cb02b8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php @@ -0,0 +1,189 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Notifications.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NotificationInstance 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 NotificationPage Page of NotificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NotificationPage + { + $options = new Values($options); + + $params = Values::of([ + '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 NotificationPage Page of NotificationInstance + */ + public function getPage(string $targetUrl): NotificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NotificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NotificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. + */ + public function getContext( + string $sid + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php new file mode 100644 index 0000000..5b873e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php @@ -0,0 +1,132 @@ +=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return ReadNotificationOptions Options builder + */ + public static function read( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ): ReadNotificationOptions + { + return new ReadNotificationOptions( + $log, + $messageDateBefore, + $messageDate, + $messageDateAfter + ); + } + +} + + +class ReadNotificationOptions extends Options + { + /** + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + */ + public function __construct( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ) { + $this->options['log'] = $log; + $this->options['messageDateBefore'] = $messageDateBefore; + $this->options['messageDate'] = $messageDate; + $this->options['messageDateAfter'] = $messageDateAfter; + } + + /** + * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @return $this Fluent Builder + */ + public function setLog(int $log): self + { + $this->options['log'] = $log; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateBefore(string $messageDateBefore): self + { + $this->options['messageDateBefore'] = $messageDateBefore; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDate(string $messageDate): self + { + $this->options['messageDate'] = $messageDate; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateAfter(string $messageDateAfter): self + { + $this->options['messageDateAfter'] = $messageDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php new file mode 100644 index 0000000..96183d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\Call\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php new file mode 100644 index 0000000..7c319e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php @@ -0,0 +1,112 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Payments/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. + * @param array|Options $options Optional Arguments + * @return PaymentInstance Updated PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IdempotencyKey' => + $idempotencyKey, + 'StatusCallback' => + $statusCallback, + 'Capture' => + $options['capture'], + 'Status' => + $options['status'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new PaymentInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PaymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php new file mode 100644 index 0000000..5d0c00e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, '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 = ['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 PaymentContext Context for this PaymentInstance + */ + protected function proxy(): PaymentContext + { + if (!$this->context) { + $this->context = new PaymentContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. + * @param array|Options $options Optional Arguments + * @return PaymentInstance Updated PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + return $this->proxy()->update($idempotencyKey, $statusCallback, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PaymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php new file mode 100644 index 0000000..3d0aeb7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php @@ -0,0 +1,146 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Payments.json'; + } + + /** + * Create the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) + * @param array|Options $options Optional Arguments + * @return PaymentInstance Created PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IdempotencyKey' => + $idempotencyKey, + 'StatusCallback' => + $statusCallback, + 'BankAccountType' => + $options['bankAccountType'], + 'ChargeAmount' => + $options['chargeAmount'], + 'Currency' => + $options['currency'], + 'Description' => + $options['description'], + 'Input' => + $options['input'], + 'MinPostalCodeLength' => + $options['minPostalCodeLength'], + 'Parameter' => + Serialize::jsonObject($options['parameter']), + 'PaymentConnector' => + $options['paymentConnector'], + 'PaymentMethod' => + $options['paymentMethod'], + 'PostalCode' => + Serialize::booleanToString($options['postalCode']), + 'SecurityCode' => + Serialize::booleanToString($options['securityCode']), + 'Timeout' => + $options['timeout'], + 'TokenType' => + $options['tokenType'], + 'ValidCardTypes' => + $options['validCardTypes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PaymentInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a PaymentContext + * + * @param string $sid The SID of Payments session that needs to be updated. + */ + public function getContext( + string $sid + + ): PaymentContext + { + return new PaymentContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PaymentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php new file mode 100644 index 0000000..93279b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php @@ -0,0 +1,370 @@ + Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @param string $paymentMethod + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @param string $tokenType + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * @return CreatePaymentOptions Options builder + */ + public static function create( + + string $bankAccountType = Values::NONE, + string $chargeAmount = Values::NONE, + string $currency = Values::NONE, + string $description = Values::NONE, + string $input = Values::NONE, + int $minPostalCodeLength = Values::INT_NONE, + array $parameter = Values::ARRAY_NONE, + string $paymentConnector = Values::NONE, + string $paymentMethod = Values::NONE, + bool $postalCode = Values::BOOL_NONE, + bool $securityCode = Values::BOOL_NONE, + int $timeout = Values::INT_NONE, + string $tokenType = Values::NONE, + string $validCardTypes = Values::NONE + + ): CreatePaymentOptions + { + return new CreatePaymentOptions( + $bankAccountType, + $chargeAmount, + $currency, + $description, + $input, + $minPostalCodeLength, + $parameter, + $paymentConnector, + $paymentMethod, + $postalCode, + $securityCode, + $timeout, + $tokenType, + $validCardTypes + ); + } + + /** + * @param string $capture + * @param string $status + * @return UpdatePaymentOptions Options builder + */ + public static function update( + + string $capture = Values::NONE, + string $status = Values::NONE + + ): UpdatePaymentOptions + { + return new UpdatePaymentOptions( + $capture, + $status + ); + } + +} + +class CreatePaymentOptions extends Options + { + /** + * @param string $bankAccountType + * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @param string $paymentMethod + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @param string $tokenType + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + */ + public function __construct( + + string $bankAccountType = Values::NONE, + string $chargeAmount = Values::NONE, + string $currency = Values::NONE, + string $description = Values::NONE, + string $input = Values::NONE, + int $minPostalCodeLength = Values::INT_NONE, + array $parameter = Values::ARRAY_NONE, + string $paymentConnector = Values::NONE, + string $paymentMethod = Values::NONE, + bool $postalCode = Values::BOOL_NONE, + bool $securityCode = Values::BOOL_NONE, + int $timeout = Values::INT_NONE, + string $tokenType = Values::NONE, + string $validCardTypes = Values::NONE + + ) { + $this->options['bankAccountType'] = $bankAccountType; + $this->options['chargeAmount'] = $chargeAmount; + $this->options['currency'] = $currency; + $this->options['description'] = $description; + $this->options['input'] = $input; + $this->options['minPostalCodeLength'] = $minPostalCodeLength; + $this->options['parameter'] = $parameter; + $this->options['paymentConnector'] = $paymentConnector; + $this->options['paymentMethod'] = $paymentMethod; + $this->options['postalCode'] = $postalCode; + $this->options['securityCode'] = $securityCode; + $this->options['timeout'] = $timeout; + $this->options['tokenType'] = $tokenType; + $this->options['validCardTypes'] = $validCardTypes; + } + + /** + * @param string $bankAccountType + * @return $this Fluent Builder + */ + public function setBankAccountType(string $bankAccountType): self + { + $this->options['bankAccountType'] = $bankAccountType; + return $this; + } + + /** + * A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * + * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * @return $this Fluent Builder + */ + public function setChargeAmount(string $chargeAmount): self + { + $this->options['chargeAmount'] = $chargeAmount; + return $this; + } + + /** + * The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * + * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * @return $this Fluent Builder + */ + public function setCurrency(string $currency): self + { + $this->options['currency'] = $currency; + return $this; + } + + /** + * The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * + * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * + * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * @return $this Fluent Builder + */ + public function setInput(string $input): self + { + $this->options['input'] = $input; + return $this; + } + + /** + * A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * + * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * @return $this Fluent Builder + */ + public function setMinPostalCodeLength(int $minPostalCodeLength): self + { + $this->options['minPostalCodeLength'] = $minPostalCodeLength; + return $this; + } + + /** + * A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * + * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @return $this Fluent Builder + */ + public function setParameter(array $parameter): self + { + $this->options['parameter'] = $parameter; + return $this; + } + + /** + * This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @return $this Fluent Builder + */ + public function setPaymentConnector(string $paymentConnector): self + { + $this->options['paymentConnector'] = $paymentConnector; + return $this; + } + + /** + * @param string $paymentMethod + * @return $this Fluent Builder + */ + public function setPaymentMethod(string $paymentMethod): self + { + $this->options['paymentMethod'] = $paymentMethod; + return $this; + } + + /** + * Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @return $this Fluent Builder + */ + public function setPostalCode(bool $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @return $this Fluent Builder + */ + public function setSecurityCode(bool $securityCode): self + { + $this->options['securityCode'] = $securityCode; + return $this; + } + + /** + * The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * @param string $tokenType + * @return $this Fluent Builder + */ + public function setTokenType(string $tokenType): self + { + $this->options['tokenType'] = $tokenType; + return $this; + } + + /** + * Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * @return $this Fluent Builder + */ + public function setValidCardTypes(string $validCardTypes): self + { + $this->options['validCardTypes'] = $validCardTypes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']'; + } +} + +class UpdatePaymentOptions extends Options + { + /** + * @param string $capture + * @param string $status + */ + public function __construct( + + string $capture = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['capture'] = $capture; + $this->options['status'] = $status; + } + + /** + * @param string $capture + * @return $this Fluent Builder + */ + public function setCapture(string $capture): self + { + $this->options['capture'] = $capture; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php new file mode 100644 index 0000000..3c7f0a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PaymentInstance \Twilio\Rest\Api\V2010\Account\Call\PaymentInstance + */ + public function buildInstance(array $payload): PaymentInstance + { + return new PaymentInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PaymentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php new file mode 100644 index 0000000..b1df68c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php @@ -0,0 +1,143 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'PauseBehavior' => + $options['pauseBehavior'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php new file mode 100644 index 0000000..a028c54 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'uri' => Values::array_get($payload, 'uri'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'track' => Values::array_get($payload, 'track'), + ]; + + $this->solution = ['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 RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + return $this->proxy()->update($status, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php new file mode 100644 index 0000000..f4b93c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php @@ -0,0 +1,227 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Recordings.json'; + } + + /** + * Create the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Created RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'Trim' => + $options['trim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingTrack' => + $options['recordingTrack'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance 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 RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + '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 RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php new file mode 100644 index 0000000..3977278 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php @@ -0,0 +1,310 @@ +=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return UpdateRecordingOptions Options builder + */ + public static function update( + + string $pauseBehavior = Values::NONE + + ): UpdateRecordingOptions + { + return new UpdateRecordingOptions( + $pauseBehavior + ); + } + +} + +class CreateRecordingOptions extends Options + { + /** + * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + */ + public function __construct( + + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $trim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingTrack = Values::NONE + + ) { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['trim'] = $trim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingTrack'] = $recordingTrack; + } + + /** + * The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * + * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * + * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * + * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * + * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateRecordingOptions ' . $options . ']'; + } +} + + + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + +class UpdateRecordingOptions extends Options + { + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + */ + public function __construct( + + string $pauseBehavior = Values::NONE + + ) { + $this->options['pauseBehavior'] = $pauseBehavior; + } + + /** + * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return $this Fluent Builder + */ + public function setPauseBehavior(string $pauseBehavior): self + { + $this->options['pauseBehavior'] = $pauseBehavior; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php new file mode 100644 index 0000000..178cfaa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Call\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php new file mode 100644 index 0000000..45f2093 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php @@ -0,0 +1,101 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Siprec/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the SiprecInstance + * + * @param string $status + * @return SiprecInstance Updated SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): SiprecInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SiprecInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SiprecContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php new file mode 100644 index 0000000..90867ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'name' => Values::array_get($payload, 'name'), + 'status' => Values::array_get($payload, 'status'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 SiprecContext Context for this SiprecInstance + */ + protected function proxy(): SiprecContext + { + if (!$this->context) { + $this->context = new SiprecContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the SiprecInstance + * + * @param string $status + * @return SiprecInstance Updated SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): SiprecInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SiprecInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php new file mode 100644 index 0000000..895f387 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php @@ -0,0 +1,517 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Siprec.json'; + } + + /** + * Create the SiprecInstance + * + * @param array|Options $options Optional Arguments + * @return SiprecInstance Created SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SiprecInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $options['name'], + 'ConnectorName' => + $options['connectorName'], + 'Track' => + $options['track'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Parameter1.Name' => + $options['parameter1Name'], + 'Parameter1.Value' => + $options['parameter1Value'], + 'Parameter2.Name' => + $options['parameter2Name'], + 'Parameter2.Value' => + $options['parameter2Value'], + 'Parameter3.Name' => + $options['parameter3Name'], + 'Parameter3.Value' => + $options['parameter3Value'], + 'Parameter4.Name' => + $options['parameter4Name'], + 'Parameter4.Value' => + $options['parameter4Value'], + 'Parameter5.Name' => + $options['parameter5Name'], + 'Parameter5.Value' => + $options['parameter5Value'], + 'Parameter6.Name' => + $options['parameter6Name'], + 'Parameter6.Value' => + $options['parameter6Value'], + 'Parameter7.Name' => + $options['parameter7Name'], + 'Parameter7.Value' => + $options['parameter7Value'], + 'Parameter8.Name' => + $options['parameter8Name'], + 'Parameter8.Value' => + $options['parameter8Value'], + 'Parameter9.Name' => + $options['parameter9Name'], + 'Parameter9.Value' => + $options['parameter9Value'], + 'Parameter10.Name' => + $options['parameter10Name'], + 'Parameter10.Value' => + $options['parameter10Value'], + 'Parameter11.Name' => + $options['parameter11Name'], + 'Parameter11.Value' => + $options['parameter11Value'], + 'Parameter12.Name' => + $options['parameter12Name'], + 'Parameter12.Value' => + $options['parameter12Value'], + 'Parameter13.Name' => + $options['parameter13Name'], + 'Parameter13.Value' => + $options['parameter13Value'], + 'Parameter14.Name' => + $options['parameter14Name'], + 'Parameter14.Value' => + $options['parameter14Value'], + 'Parameter15.Name' => + $options['parameter15Name'], + 'Parameter15.Value' => + $options['parameter15Value'], + 'Parameter16.Name' => + $options['parameter16Name'], + 'Parameter16.Value' => + $options['parameter16Value'], + 'Parameter17.Name' => + $options['parameter17Name'], + 'Parameter17.Value' => + $options['parameter17Value'], + 'Parameter18.Name' => + $options['parameter18Name'], + 'Parameter18.Value' => + $options['parameter18Value'], + 'Parameter19.Name' => + $options['parameter19Name'], + 'Parameter19.Value' => + $options['parameter19Value'], + 'Parameter20.Name' => + $options['parameter20Name'], + 'Parameter20.Value' => + $options['parameter20Value'], + 'Parameter21.Name' => + $options['parameter21Name'], + 'Parameter21.Value' => + $options['parameter21Value'], + 'Parameter22.Name' => + $options['parameter22Name'], + 'Parameter22.Value' => + $options['parameter22Value'], + 'Parameter23.Name' => + $options['parameter23Name'], + 'Parameter23.Value' => + $options['parameter23Value'], + 'Parameter24.Name' => + $options['parameter24Name'], + 'Parameter24.Value' => + $options['parameter24Value'], + 'Parameter25.Name' => + $options['parameter25Name'], + 'Parameter25.Value' => + $options['parameter25Value'], + 'Parameter26.Name' => + $options['parameter26Name'], + 'Parameter26.Value' => + $options['parameter26Value'], + 'Parameter27.Name' => + $options['parameter27Name'], + 'Parameter27.Value' => + $options['parameter27Value'], + 'Parameter28.Name' => + $options['parameter28Name'], + 'Parameter28.Value' => + $options['parameter28Value'], + 'Parameter29.Name' => + $options['parameter29Name'], + 'Parameter29.Value' => + $options['parameter29Value'], + 'Parameter30.Name' => + $options['parameter30Name'], + 'Parameter30.Value' => + $options['parameter30Value'], + 'Parameter31.Name' => + $options['parameter31Name'], + 'Parameter31.Value' => + $options['parameter31Value'], + 'Parameter32.Name' => + $options['parameter32Name'], + 'Parameter32.Value' => + $options['parameter32Value'], + 'Parameter33.Name' => + $options['parameter33Name'], + 'Parameter33.Value' => + $options['parameter33Value'], + 'Parameter34.Name' => + $options['parameter34Name'], + 'Parameter34.Value' => + $options['parameter34Value'], + 'Parameter35.Name' => + $options['parameter35Name'], + 'Parameter35.Value' => + $options['parameter35Value'], + 'Parameter36.Name' => + $options['parameter36Name'], + 'Parameter36.Value' => + $options['parameter36Value'], + 'Parameter37.Name' => + $options['parameter37Name'], + 'Parameter37.Value' => + $options['parameter37Value'], + 'Parameter38.Name' => + $options['parameter38Name'], + 'Parameter38.Value' => + $options['parameter38Value'], + 'Parameter39.Name' => + $options['parameter39Name'], + 'Parameter39.Value' => + $options['parameter39Value'], + 'Parameter40.Name' => + $options['parameter40Name'], + 'Parameter40.Value' => + $options['parameter40Value'], + 'Parameter41.Name' => + $options['parameter41Name'], + 'Parameter41.Value' => + $options['parameter41Value'], + 'Parameter42.Name' => + $options['parameter42Name'], + 'Parameter42.Value' => + $options['parameter42Value'], + 'Parameter43.Name' => + $options['parameter43Name'], + 'Parameter43.Value' => + $options['parameter43Value'], + 'Parameter44.Name' => + $options['parameter44Name'], + 'Parameter44.Value' => + $options['parameter44Value'], + 'Parameter45.Name' => + $options['parameter45Name'], + 'Parameter45.Value' => + $options['parameter45Value'], + 'Parameter46.Name' => + $options['parameter46Name'], + 'Parameter46.Value' => + $options['parameter46Value'], + 'Parameter47.Name' => + $options['parameter47Name'], + 'Parameter47.Value' => + $options['parameter47Value'], + 'Parameter48.Name' => + $options['parameter48Name'], + 'Parameter48.Value' => + $options['parameter48Value'], + 'Parameter49.Name' => + $options['parameter49Name'], + 'Parameter49.Value' => + $options['parameter49Value'], + 'Parameter50.Name' => + $options['parameter50Name'], + 'Parameter50.Value' => + $options['parameter50Value'], + 'Parameter51.Name' => + $options['parameter51Name'], + 'Parameter51.Value' => + $options['parameter51Value'], + 'Parameter52.Name' => + $options['parameter52Name'], + 'Parameter52.Value' => + $options['parameter52Value'], + 'Parameter53.Name' => + $options['parameter53Name'], + 'Parameter53.Value' => + $options['parameter53Value'], + 'Parameter54.Name' => + $options['parameter54Name'], + 'Parameter54.Value' => + $options['parameter54Value'], + 'Parameter55.Name' => + $options['parameter55Name'], + 'Parameter55.Value' => + $options['parameter55Value'], + 'Parameter56.Name' => + $options['parameter56Name'], + 'Parameter56.Value' => + $options['parameter56Value'], + 'Parameter57.Name' => + $options['parameter57Name'], + 'Parameter57.Value' => + $options['parameter57Value'], + 'Parameter58.Name' => + $options['parameter58Name'], + 'Parameter58.Value' => + $options['parameter58Value'], + 'Parameter59.Name' => + $options['parameter59Name'], + 'Parameter59.Value' => + $options['parameter59Value'], + 'Parameter60.Name' => + $options['parameter60Name'], + 'Parameter60.Value' => + $options['parameter60Value'], + 'Parameter61.Name' => + $options['parameter61Name'], + 'Parameter61.Value' => + $options['parameter61Value'], + 'Parameter62.Name' => + $options['parameter62Name'], + 'Parameter62.Value' => + $options['parameter62Value'], + 'Parameter63.Name' => + $options['parameter63Name'], + 'Parameter63.Value' => + $options['parameter63Value'], + 'Parameter64.Name' => + $options['parameter64Name'], + 'Parameter64.Value' => + $options['parameter64Value'], + 'Parameter65.Name' => + $options['parameter65Name'], + 'Parameter65.Value' => + $options['parameter65Value'], + 'Parameter66.Name' => + $options['parameter66Name'], + 'Parameter66.Value' => + $options['parameter66Value'], + 'Parameter67.Name' => + $options['parameter67Name'], + 'Parameter67.Value' => + $options['parameter67Value'], + 'Parameter68.Name' => + $options['parameter68Name'], + 'Parameter68.Value' => + $options['parameter68Value'], + 'Parameter69.Name' => + $options['parameter69Name'], + 'Parameter69.Value' => + $options['parameter69Value'], + 'Parameter70.Name' => + $options['parameter70Name'], + 'Parameter70.Value' => + $options['parameter70Value'], + 'Parameter71.Name' => + $options['parameter71Name'], + 'Parameter71.Value' => + $options['parameter71Value'], + 'Parameter72.Name' => + $options['parameter72Name'], + 'Parameter72.Value' => + $options['parameter72Value'], + 'Parameter73.Name' => + $options['parameter73Name'], + 'Parameter73.Value' => + $options['parameter73Value'], + 'Parameter74.Name' => + $options['parameter74Name'], + 'Parameter74.Value' => + $options['parameter74Value'], + 'Parameter75.Name' => + $options['parameter75Name'], + 'Parameter75.Value' => + $options['parameter75Value'], + 'Parameter76.Name' => + $options['parameter76Name'], + 'Parameter76.Value' => + $options['parameter76Value'], + 'Parameter77.Name' => + $options['parameter77Name'], + 'Parameter77.Value' => + $options['parameter77Value'], + 'Parameter78.Name' => + $options['parameter78Name'], + 'Parameter78.Value' => + $options['parameter78Value'], + 'Parameter79.Name' => + $options['parameter79Name'], + 'Parameter79.Value' => + $options['parameter79Value'], + 'Parameter80.Name' => + $options['parameter80Name'], + 'Parameter80.Value' => + $options['parameter80Value'], + 'Parameter81.Name' => + $options['parameter81Name'], + 'Parameter81.Value' => + $options['parameter81Value'], + 'Parameter82.Name' => + $options['parameter82Name'], + 'Parameter82.Value' => + $options['parameter82Value'], + 'Parameter83.Name' => + $options['parameter83Name'], + 'Parameter83.Value' => + $options['parameter83Value'], + 'Parameter84.Name' => + $options['parameter84Name'], + 'Parameter84.Value' => + $options['parameter84Value'], + 'Parameter85.Name' => + $options['parameter85Name'], + 'Parameter85.Value' => + $options['parameter85Value'], + 'Parameter86.Name' => + $options['parameter86Name'], + 'Parameter86.Value' => + $options['parameter86Value'], + 'Parameter87.Name' => + $options['parameter87Name'], + 'Parameter87.Value' => + $options['parameter87Value'], + 'Parameter88.Name' => + $options['parameter88Name'], + 'Parameter88.Value' => + $options['parameter88Value'], + 'Parameter89.Name' => + $options['parameter89Name'], + 'Parameter89.Value' => + $options['parameter89Value'], + 'Parameter90.Name' => + $options['parameter90Name'], + 'Parameter90.Value' => + $options['parameter90Value'], + 'Parameter91.Name' => + $options['parameter91Name'], + 'Parameter91.Value' => + $options['parameter91Value'], + 'Parameter92.Name' => + $options['parameter92Name'], + 'Parameter92.Value' => + $options['parameter92Value'], + 'Parameter93.Name' => + $options['parameter93Name'], + 'Parameter93.Value' => + $options['parameter93Value'], + 'Parameter94.Name' => + $options['parameter94Name'], + 'Parameter94.Value' => + $options['parameter94Value'], + 'Parameter95.Name' => + $options['parameter95Name'], + 'Parameter95.Value' => + $options['parameter95Value'], + 'Parameter96.Name' => + $options['parameter96Name'], + 'Parameter96.Value' => + $options['parameter96Value'], + 'Parameter97.Name' => + $options['parameter97Name'], + 'Parameter97.Value' => + $options['parameter97Value'], + 'Parameter98.Name' => + $options['parameter98Name'], + 'Parameter98.Value' => + $options['parameter98Value'], + 'Parameter99.Name' => + $options['parameter99Name'], + 'Parameter99.Value' => + $options['parameter99Value'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SiprecInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a SiprecContext + * + * @param string $sid The SID of the Siprec resource, or the `name` used when creating the resource + */ + public function getContext( + string $sid + + ): SiprecContext + { + return new SiprecContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SiprecList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php new file mode 100644 index 0000000..3155ce8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php @@ -0,0 +1,3712 @@ +options['name'] = $name; + $this->options['connectorName'] = $connectorName; + $this->options['track'] = $track; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['parameter1Name'] = $parameter1Name; + $this->options['parameter1Value'] = $parameter1Value; + $this->options['parameter2Name'] = $parameter2Name; + $this->options['parameter2Value'] = $parameter2Value; + $this->options['parameter3Name'] = $parameter3Name; + $this->options['parameter3Value'] = $parameter3Value; + $this->options['parameter4Name'] = $parameter4Name; + $this->options['parameter4Value'] = $parameter4Value; + $this->options['parameter5Name'] = $parameter5Name; + $this->options['parameter5Value'] = $parameter5Value; + $this->options['parameter6Name'] = $parameter6Name; + $this->options['parameter6Value'] = $parameter6Value; + $this->options['parameter7Name'] = $parameter7Name; + $this->options['parameter7Value'] = $parameter7Value; + $this->options['parameter8Name'] = $parameter8Name; + $this->options['parameter8Value'] = $parameter8Value; + $this->options['parameter9Name'] = $parameter9Name; + $this->options['parameter9Value'] = $parameter9Value; + $this->options['parameter10Name'] = $parameter10Name; + $this->options['parameter10Value'] = $parameter10Value; + $this->options['parameter11Name'] = $parameter11Name; + $this->options['parameter11Value'] = $parameter11Value; + $this->options['parameter12Name'] = $parameter12Name; + $this->options['parameter12Value'] = $parameter12Value; + $this->options['parameter13Name'] = $parameter13Name; + $this->options['parameter13Value'] = $parameter13Value; + $this->options['parameter14Name'] = $parameter14Name; + $this->options['parameter14Value'] = $parameter14Value; + $this->options['parameter15Name'] = $parameter15Name; + $this->options['parameter15Value'] = $parameter15Value; + $this->options['parameter16Name'] = $parameter16Name; + $this->options['parameter16Value'] = $parameter16Value; + $this->options['parameter17Name'] = $parameter17Name; + $this->options['parameter17Value'] = $parameter17Value; + $this->options['parameter18Name'] = $parameter18Name; + $this->options['parameter18Value'] = $parameter18Value; + $this->options['parameter19Name'] = $parameter19Name; + $this->options['parameter19Value'] = $parameter19Value; + $this->options['parameter20Name'] = $parameter20Name; + $this->options['parameter20Value'] = $parameter20Value; + $this->options['parameter21Name'] = $parameter21Name; + $this->options['parameter21Value'] = $parameter21Value; + $this->options['parameter22Name'] = $parameter22Name; + $this->options['parameter22Value'] = $parameter22Value; + $this->options['parameter23Name'] = $parameter23Name; + $this->options['parameter23Value'] = $parameter23Value; + $this->options['parameter24Name'] = $parameter24Name; + $this->options['parameter24Value'] = $parameter24Value; + $this->options['parameter25Name'] = $parameter25Name; + $this->options['parameter25Value'] = $parameter25Value; + $this->options['parameter26Name'] = $parameter26Name; + $this->options['parameter26Value'] = $parameter26Value; + $this->options['parameter27Name'] = $parameter27Name; + $this->options['parameter27Value'] = $parameter27Value; + $this->options['parameter28Name'] = $parameter28Name; + $this->options['parameter28Value'] = $parameter28Value; + $this->options['parameter29Name'] = $parameter29Name; + $this->options['parameter29Value'] = $parameter29Value; + $this->options['parameter30Name'] = $parameter30Name; + $this->options['parameter30Value'] = $parameter30Value; + $this->options['parameter31Name'] = $parameter31Name; + $this->options['parameter31Value'] = $parameter31Value; + $this->options['parameter32Name'] = $parameter32Name; + $this->options['parameter32Value'] = $parameter32Value; + $this->options['parameter33Name'] = $parameter33Name; + $this->options['parameter33Value'] = $parameter33Value; + $this->options['parameter34Name'] = $parameter34Name; + $this->options['parameter34Value'] = $parameter34Value; + $this->options['parameter35Name'] = $parameter35Name; + $this->options['parameter35Value'] = $parameter35Value; + $this->options['parameter36Name'] = $parameter36Name; + $this->options['parameter36Value'] = $parameter36Value; + $this->options['parameter37Name'] = $parameter37Name; + $this->options['parameter37Value'] = $parameter37Value; + $this->options['parameter38Name'] = $parameter38Name; + $this->options['parameter38Value'] = $parameter38Value; + $this->options['parameter39Name'] = $parameter39Name; + $this->options['parameter39Value'] = $parameter39Value; + $this->options['parameter40Name'] = $parameter40Name; + $this->options['parameter40Value'] = $parameter40Value; + $this->options['parameter41Name'] = $parameter41Name; + $this->options['parameter41Value'] = $parameter41Value; + $this->options['parameter42Name'] = $parameter42Name; + $this->options['parameter42Value'] = $parameter42Value; + $this->options['parameter43Name'] = $parameter43Name; + $this->options['parameter43Value'] = $parameter43Value; + $this->options['parameter44Name'] = $parameter44Name; + $this->options['parameter44Value'] = $parameter44Value; + $this->options['parameter45Name'] = $parameter45Name; + $this->options['parameter45Value'] = $parameter45Value; + $this->options['parameter46Name'] = $parameter46Name; + $this->options['parameter46Value'] = $parameter46Value; + $this->options['parameter47Name'] = $parameter47Name; + $this->options['parameter47Value'] = $parameter47Value; + $this->options['parameter48Name'] = $parameter48Name; + $this->options['parameter48Value'] = $parameter48Value; + $this->options['parameter49Name'] = $parameter49Name; + $this->options['parameter49Value'] = $parameter49Value; + $this->options['parameter50Name'] = $parameter50Name; + $this->options['parameter50Value'] = $parameter50Value; + $this->options['parameter51Name'] = $parameter51Name; + $this->options['parameter51Value'] = $parameter51Value; + $this->options['parameter52Name'] = $parameter52Name; + $this->options['parameter52Value'] = $parameter52Value; + $this->options['parameter53Name'] = $parameter53Name; + $this->options['parameter53Value'] = $parameter53Value; + $this->options['parameter54Name'] = $parameter54Name; + $this->options['parameter54Value'] = $parameter54Value; + $this->options['parameter55Name'] = $parameter55Name; + $this->options['parameter55Value'] = $parameter55Value; + $this->options['parameter56Name'] = $parameter56Name; + $this->options['parameter56Value'] = $parameter56Value; + $this->options['parameter57Name'] = $parameter57Name; + $this->options['parameter57Value'] = $parameter57Value; + $this->options['parameter58Name'] = $parameter58Name; + $this->options['parameter58Value'] = $parameter58Value; + $this->options['parameter59Name'] = $parameter59Name; + $this->options['parameter59Value'] = $parameter59Value; + $this->options['parameter60Name'] = $parameter60Name; + $this->options['parameter60Value'] = $parameter60Value; + $this->options['parameter61Name'] = $parameter61Name; + $this->options['parameter61Value'] = $parameter61Value; + $this->options['parameter62Name'] = $parameter62Name; + $this->options['parameter62Value'] = $parameter62Value; + $this->options['parameter63Name'] = $parameter63Name; + $this->options['parameter63Value'] = $parameter63Value; + $this->options['parameter64Name'] = $parameter64Name; + $this->options['parameter64Value'] = $parameter64Value; + $this->options['parameter65Name'] = $parameter65Name; + $this->options['parameter65Value'] = $parameter65Value; + $this->options['parameter66Name'] = $parameter66Name; + $this->options['parameter66Value'] = $parameter66Value; + $this->options['parameter67Name'] = $parameter67Name; + $this->options['parameter67Value'] = $parameter67Value; + $this->options['parameter68Name'] = $parameter68Name; + $this->options['parameter68Value'] = $parameter68Value; + $this->options['parameter69Name'] = $parameter69Name; + $this->options['parameter69Value'] = $parameter69Value; + $this->options['parameter70Name'] = $parameter70Name; + $this->options['parameter70Value'] = $parameter70Value; + $this->options['parameter71Name'] = $parameter71Name; + $this->options['parameter71Value'] = $parameter71Value; + $this->options['parameter72Name'] = $parameter72Name; + $this->options['parameter72Value'] = $parameter72Value; + $this->options['parameter73Name'] = $parameter73Name; + $this->options['parameter73Value'] = $parameter73Value; + $this->options['parameter74Name'] = $parameter74Name; + $this->options['parameter74Value'] = $parameter74Value; + $this->options['parameter75Name'] = $parameter75Name; + $this->options['parameter75Value'] = $parameter75Value; + $this->options['parameter76Name'] = $parameter76Name; + $this->options['parameter76Value'] = $parameter76Value; + $this->options['parameter77Name'] = $parameter77Name; + $this->options['parameter77Value'] = $parameter77Value; + $this->options['parameter78Name'] = $parameter78Name; + $this->options['parameter78Value'] = $parameter78Value; + $this->options['parameter79Name'] = $parameter79Name; + $this->options['parameter79Value'] = $parameter79Value; + $this->options['parameter80Name'] = $parameter80Name; + $this->options['parameter80Value'] = $parameter80Value; + $this->options['parameter81Name'] = $parameter81Name; + $this->options['parameter81Value'] = $parameter81Value; + $this->options['parameter82Name'] = $parameter82Name; + $this->options['parameter82Value'] = $parameter82Value; + $this->options['parameter83Name'] = $parameter83Name; + $this->options['parameter83Value'] = $parameter83Value; + $this->options['parameter84Name'] = $parameter84Name; + $this->options['parameter84Value'] = $parameter84Value; + $this->options['parameter85Name'] = $parameter85Name; + $this->options['parameter85Value'] = $parameter85Value; + $this->options['parameter86Name'] = $parameter86Name; + $this->options['parameter86Value'] = $parameter86Value; + $this->options['parameter87Name'] = $parameter87Name; + $this->options['parameter87Value'] = $parameter87Value; + $this->options['parameter88Name'] = $parameter88Name; + $this->options['parameter88Value'] = $parameter88Value; + $this->options['parameter89Name'] = $parameter89Name; + $this->options['parameter89Value'] = $parameter89Value; + $this->options['parameter90Name'] = $parameter90Name; + $this->options['parameter90Value'] = $parameter90Value; + $this->options['parameter91Name'] = $parameter91Name; + $this->options['parameter91Value'] = $parameter91Value; + $this->options['parameter92Name'] = $parameter92Name; + $this->options['parameter92Value'] = $parameter92Value; + $this->options['parameter93Name'] = $parameter93Name; + $this->options['parameter93Value'] = $parameter93Value; + $this->options['parameter94Name'] = $parameter94Name; + $this->options['parameter94Value'] = $parameter94Value; + $this->options['parameter95Name'] = $parameter95Name; + $this->options['parameter95Value'] = $parameter95Value; + $this->options['parameter96Name'] = $parameter96Name; + $this->options['parameter96Value'] = $parameter96Value; + $this->options['parameter97Name'] = $parameter97Name; + $this->options['parameter97Value'] = $parameter97Value; + $this->options['parameter98Name'] = $parameter98Name; + $this->options['parameter98Value'] = $parameter98Value; + $this->options['parameter99Name'] = $parameter99Name; + $this->options['parameter99Value'] = $parameter99Value; + } + + /** + * The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. + * + * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * Unique name used when configuring the connector via Marketplace Add-on. + * + * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. + * @return $this Fluent Builder + */ + public function setConnectorName(string $connectorName): self + { + $this->options['connectorName'] = $connectorName; + return $this; + } + + /** + * @param string $track + * @return $this Fluent Builder + */ + public function setTrack(string $track): self + { + $this->options['track'] = $track; + return $this; + } + + /** + * Absolute URL of the status callback. + * + * @param string $statusCallback Absolute URL of the status callback. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The http method for the status_callback (one of GET, POST). + * + * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter1Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter1Name(string $parameter1Name): self + { + $this->options['parameter1Name'] = $parameter1Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter1Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter1Value(string $parameter1Value): self + { + $this->options['parameter1Value'] = $parameter1Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter2Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter2Name(string $parameter2Name): self + { + $this->options['parameter2Name'] = $parameter2Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter2Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter2Value(string $parameter2Value): self + { + $this->options['parameter2Value'] = $parameter2Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter3Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter3Name(string $parameter3Name): self + { + $this->options['parameter3Name'] = $parameter3Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter3Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter3Value(string $parameter3Value): self + { + $this->options['parameter3Value'] = $parameter3Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter4Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter4Name(string $parameter4Name): self + { + $this->options['parameter4Name'] = $parameter4Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter4Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter4Value(string $parameter4Value): self + { + $this->options['parameter4Value'] = $parameter4Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter5Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter5Name(string $parameter5Name): self + { + $this->options['parameter5Name'] = $parameter5Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter5Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter5Value(string $parameter5Value): self + { + $this->options['parameter5Value'] = $parameter5Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter6Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter6Name(string $parameter6Name): self + { + $this->options['parameter6Name'] = $parameter6Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter6Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter6Value(string $parameter6Value): self + { + $this->options['parameter6Value'] = $parameter6Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter7Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter7Name(string $parameter7Name): self + { + $this->options['parameter7Name'] = $parameter7Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter7Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter7Value(string $parameter7Value): self + { + $this->options['parameter7Value'] = $parameter7Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter8Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter8Name(string $parameter8Name): self + { + $this->options['parameter8Name'] = $parameter8Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter8Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter8Value(string $parameter8Value): self + { + $this->options['parameter8Value'] = $parameter8Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter9Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter9Name(string $parameter9Name): self + { + $this->options['parameter9Name'] = $parameter9Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter9Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter9Value(string $parameter9Value): self + { + $this->options['parameter9Value'] = $parameter9Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter10Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter10Name(string $parameter10Name): self + { + $this->options['parameter10Name'] = $parameter10Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter10Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter10Value(string $parameter10Value): self + { + $this->options['parameter10Value'] = $parameter10Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter11Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter11Name(string $parameter11Name): self + { + $this->options['parameter11Name'] = $parameter11Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter11Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter11Value(string $parameter11Value): self + { + $this->options['parameter11Value'] = $parameter11Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter12Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter12Name(string $parameter12Name): self + { + $this->options['parameter12Name'] = $parameter12Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter12Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter12Value(string $parameter12Value): self + { + $this->options['parameter12Value'] = $parameter12Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter13Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter13Name(string $parameter13Name): self + { + $this->options['parameter13Name'] = $parameter13Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter13Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter13Value(string $parameter13Value): self + { + $this->options['parameter13Value'] = $parameter13Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter14Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter14Name(string $parameter14Name): self + { + $this->options['parameter14Name'] = $parameter14Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter14Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter14Value(string $parameter14Value): self + { + $this->options['parameter14Value'] = $parameter14Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter15Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter15Name(string $parameter15Name): self + { + $this->options['parameter15Name'] = $parameter15Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter15Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter15Value(string $parameter15Value): self + { + $this->options['parameter15Value'] = $parameter15Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter16Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter16Name(string $parameter16Name): self + { + $this->options['parameter16Name'] = $parameter16Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter16Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter16Value(string $parameter16Value): self + { + $this->options['parameter16Value'] = $parameter16Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter17Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter17Name(string $parameter17Name): self + { + $this->options['parameter17Name'] = $parameter17Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter17Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter17Value(string $parameter17Value): self + { + $this->options['parameter17Value'] = $parameter17Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter18Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter18Name(string $parameter18Name): self + { + $this->options['parameter18Name'] = $parameter18Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter18Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter18Value(string $parameter18Value): self + { + $this->options['parameter18Value'] = $parameter18Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter19Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter19Name(string $parameter19Name): self + { + $this->options['parameter19Name'] = $parameter19Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter19Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter19Value(string $parameter19Value): self + { + $this->options['parameter19Value'] = $parameter19Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter20Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter20Name(string $parameter20Name): self + { + $this->options['parameter20Name'] = $parameter20Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter20Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter20Value(string $parameter20Value): self + { + $this->options['parameter20Value'] = $parameter20Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter21Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter21Name(string $parameter21Name): self + { + $this->options['parameter21Name'] = $parameter21Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter21Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter21Value(string $parameter21Value): self + { + $this->options['parameter21Value'] = $parameter21Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter22Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter22Name(string $parameter22Name): self + { + $this->options['parameter22Name'] = $parameter22Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter22Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter22Value(string $parameter22Value): self + { + $this->options['parameter22Value'] = $parameter22Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter23Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter23Name(string $parameter23Name): self + { + $this->options['parameter23Name'] = $parameter23Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter23Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter23Value(string $parameter23Value): self + { + $this->options['parameter23Value'] = $parameter23Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter24Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter24Name(string $parameter24Name): self + { + $this->options['parameter24Name'] = $parameter24Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter24Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter24Value(string $parameter24Value): self + { + $this->options['parameter24Value'] = $parameter24Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter25Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter25Name(string $parameter25Name): self + { + $this->options['parameter25Name'] = $parameter25Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter25Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter25Value(string $parameter25Value): self + { + $this->options['parameter25Value'] = $parameter25Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter26Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter26Name(string $parameter26Name): self + { + $this->options['parameter26Name'] = $parameter26Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter26Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter26Value(string $parameter26Value): self + { + $this->options['parameter26Value'] = $parameter26Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter27Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter27Name(string $parameter27Name): self + { + $this->options['parameter27Name'] = $parameter27Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter27Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter27Value(string $parameter27Value): self + { + $this->options['parameter27Value'] = $parameter27Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter28Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter28Name(string $parameter28Name): self + { + $this->options['parameter28Name'] = $parameter28Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter28Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter28Value(string $parameter28Value): self + { + $this->options['parameter28Value'] = $parameter28Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter29Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter29Name(string $parameter29Name): self + { + $this->options['parameter29Name'] = $parameter29Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter29Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter29Value(string $parameter29Value): self + { + $this->options['parameter29Value'] = $parameter29Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter30Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter30Name(string $parameter30Name): self + { + $this->options['parameter30Name'] = $parameter30Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter30Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter30Value(string $parameter30Value): self + { + $this->options['parameter30Value'] = $parameter30Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter31Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter31Name(string $parameter31Name): self + { + $this->options['parameter31Name'] = $parameter31Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter31Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter31Value(string $parameter31Value): self + { + $this->options['parameter31Value'] = $parameter31Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter32Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter32Name(string $parameter32Name): self + { + $this->options['parameter32Name'] = $parameter32Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter32Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter32Value(string $parameter32Value): self + { + $this->options['parameter32Value'] = $parameter32Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter33Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter33Name(string $parameter33Name): self + { + $this->options['parameter33Name'] = $parameter33Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter33Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter33Value(string $parameter33Value): self + { + $this->options['parameter33Value'] = $parameter33Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter34Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter34Name(string $parameter34Name): self + { + $this->options['parameter34Name'] = $parameter34Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter34Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter34Value(string $parameter34Value): self + { + $this->options['parameter34Value'] = $parameter34Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter35Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter35Name(string $parameter35Name): self + { + $this->options['parameter35Name'] = $parameter35Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter35Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter35Value(string $parameter35Value): self + { + $this->options['parameter35Value'] = $parameter35Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter36Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter36Name(string $parameter36Name): self + { + $this->options['parameter36Name'] = $parameter36Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter36Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter36Value(string $parameter36Value): self + { + $this->options['parameter36Value'] = $parameter36Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter37Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter37Name(string $parameter37Name): self + { + $this->options['parameter37Name'] = $parameter37Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter37Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter37Value(string $parameter37Value): self + { + $this->options['parameter37Value'] = $parameter37Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter38Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter38Name(string $parameter38Name): self + { + $this->options['parameter38Name'] = $parameter38Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter38Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter38Value(string $parameter38Value): self + { + $this->options['parameter38Value'] = $parameter38Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter39Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter39Name(string $parameter39Name): self + { + $this->options['parameter39Name'] = $parameter39Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter39Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter39Value(string $parameter39Value): self + { + $this->options['parameter39Value'] = $parameter39Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter40Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter40Name(string $parameter40Name): self + { + $this->options['parameter40Name'] = $parameter40Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter40Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter40Value(string $parameter40Value): self + { + $this->options['parameter40Value'] = $parameter40Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter41Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter41Name(string $parameter41Name): self + { + $this->options['parameter41Name'] = $parameter41Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter41Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter41Value(string $parameter41Value): self + { + $this->options['parameter41Value'] = $parameter41Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter42Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter42Name(string $parameter42Name): self + { + $this->options['parameter42Name'] = $parameter42Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter42Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter42Value(string $parameter42Value): self + { + $this->options['parameter42Value'] = $parameter42Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter43Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter43Name(string $parameter43Name): self + { + $this->options['parameter43Name'] = $parameter43Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter43Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter43Value(string $parameter43Value): self + { + $this->options['parameter43Value'] = $parameter43Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter44Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter44Name(string $parameter44Name): self + { + $this->options['parameter44Name'] = $parameter44Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter44Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter44Value(string $parameter44Value): self + { + $this->options['parameter44Value'] = $parameter44Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter45Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter45Name(string $parameter45Name): self + { + $this->options['parameter45Name'] = $parameter45Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter45Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter45Value(string $parameter45Value): self + { + $this->options['parameter45Value'] = $parameter45Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter46Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter46Name(string $parameter46Name): self + { + $this->options['parameter46Name'] = $parameter46Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter46Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter46Value(string $parameter46Value): self + { + $this->options['parameter46Value'] = $parameter46Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter47Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter47Name(string $parameter47Name): self + { + $this->options['parameter47Name'] = $parameter47Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter47Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter47Value(string $parameter47Value): self + { + $this->options['parameter47Value'] = $parameter47Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter48Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter48Name(string $parameter48Name): self + { + $this->options['parameter48Name'] = $parameter48Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter48Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter48Value(string $parameter48Value): self + { + $this->options['parameter48Value'] = $parameter48Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter49Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter49Name(string $parameter49Name): self + { + $this->options['parameter49Name'] = $parameter49Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter49Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter49Value(string $parameter49Value): self + { + $this->options['parameter49Value'] = $parameter49Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter50Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter50Name(string $parameter50Name): self + { + $this->options['parameter50Name'] = $parameter50Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter50Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter50Value(string $parameter50Value): self + { + $this->options['parameter50Value'] = $parameter50Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter51Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter51Name(string $parameter51Name): self + { + $this->options['parameter51Name'] = $parameter51Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter51Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter51Value(string $parameter51Value): self + { + $this->options['parameter51Value'] = $parameter51Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter52Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter52Name(string $parameter52Name): self + { + $this->options['parameter52Name'] = $parameter52Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter52Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter52Value(string $parameter52Value): self + { + $this->options['parameter52Value'] = $parameter52Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter53Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter53Name(string $parameter53Name): self + { + $this->options['parameter53Name'] = $parameter53Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter53Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter53Value(string $parameter53Value): self + { + $this->options['parameter53Value'] = $parameter53Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter54Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter54Name(string $parameter54Name): self + { + $this->options['parameter54Name'] = $parameter54Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter54Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter54Value(string $parameter54Value): self + { + $this->options['parameter54Value'] = $parameter54Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter55Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter55Name(string $parameter55Name): self + { + $this->options['parameter55Name'] = $parameter55Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter55Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter55Value(string $parameter55Value): self + { + $this->options['parameter55Value'] = $parameter55Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter56Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter56Name(string $parameter56Name): self + { + $this->options['parameter56Name'] = $parameter56Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter56Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter56Value(string $parameter56Value): self + { + $this->options['parameter56Value'] = $parameter56Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter57Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter57Name(string $parameter57Name): self + { + $this->options['parameter57Name'] = $parameter57Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter57Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter57Value(string $parameter57Value): self + { + $this->options['parameter57Value'] = $parameter57Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter58Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter58Name(string $parameter58Name): self + { + $this->options['parameter58Name'] = $parameter58Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter58Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter58Value(string $parameter58Value): self + { + $this->options['parameter58Value'] = $parameter58Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter59Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter59Name(string $parameter59Name): self + { + $this->options['parameter59Name'] = $parameter59Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter59Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter59Value(string $parameter59Value): self + { + $this->options['parameter59Value'] = $parameter59Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter60Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter60Name(string $parameter60Name): self + { + $this->options['parameter60Name'] = $parameter60Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter60Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter60Value(string $parameter60Value): self + { + $this->options['parameter60Value'] = $parameter60Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter61Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter61Name(string $parameter61Name): self + { + $this->options['parameter61Name'] = $parameter61Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter61Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter61Value(string $parameter61Value): self + { + $this->options['parameter61Value'] = $parameter61Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter62Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter62Name(string $parameter62Name): self + { + $this->options['parameter62Name'] = $parameter62Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter62Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter62Value(string $parameter62Value): self + { + $this->options['parameter62Value'] = $parameter62Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter63Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter63Name(string $parameter63Name): self + { + $this->options['parameter63Name'] = $parameter63Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter63Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter63Value(string $parameter63Value): self + { + $this->options['parameter63Value'] = $parameter63Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter64Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter64Name(string $parameter64Name): self + { + $this->options['parameter64Name'] = $parameter64Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter64Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter64Value(string $parameter64Value): self + { + $this->options['parameter64Value'] = $parameter64Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter65Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter65Name(string $parameter65Name): self + { + $this->options['parameter65Name'] = $parameter65Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter65Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter65Value(string $parameter65Value): self + { + $this->options['parameter65Value'] = $parameter65Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter66Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter66Name(string $parameter66Name): self + { + $this->options['parameter66Name'] = $parameter66Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter66Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter66Value(string $parameter66Value): self + { + $this->options['parameter66Value'] = $parameter66Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter67Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter67Name(string $parameter67Name): self + { + $this->options['parameter67Name'] = $parameter67Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter67Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter67Value(string $parameter67Value): self + { + $this->options['parameter67Value'] = $parameter67Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter68Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter68Name(string $parameter68Name): self + { + $this->options['parameter68Name'] = $parameter68Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter68Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter68Value(string $parameter68Value): self + { + $this->options['parameter68Value'] = $parameter68Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter69Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter69Name(string $parameter69Name): self + { + $this->options['parameter69Name'] = $parameter69Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter69Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter69Value(string $parameter69Value): self + { + $this->options['parameter69Value'] = $parameter69Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter70Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter70Name(string $parameter70Name): self + { + $this->options['parameter70Name'] = $parameter70Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter70Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter70Value(string $parameter70Value): self + { + $this->options['parameter70Value'] = $parameter70Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter71Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter71Name(string $parameter71Name): self + { + $this->options['parameter71Name'] = $parameter71Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter71Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter71Value(string $parameter71Value): self + { + $this->options['parameter71Value'] = $parameter71Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter72Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter72Name(string $parameter72Name): self + { + $this->options['parameter72Name'] = $parameter72Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter72Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter72Value(string $parameter72Value): self + { + $this->options['parameter72Value'] = $parameter72Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter73Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter73Name(string $parameter73Name): self + { + $this->options['parameter73Name'] = $parameter73Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter73Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter73Value(string $parameter73Value): self + { + $this->options['parameter73Value'] = $parameter73Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter74Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter74Name(string $parameter74Name): self + { + $this->options['parameter74Name'] = $parameter74Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter74Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter74Value(string $parameter74Value): self + { + $this->options['parameter74Value'] = $parameter74Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter75Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter75Name(string $parameter75Name): self + { + $this->options['parameter75Name'] = $parameter75Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter75Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter75Value(string $parameter75Value): self + { + $this->options['parameter75Value'] = $parameter75Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter76Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter76Name(string $parameter76Name): self + { + $this->options['parameter76Name'] = $parameter76Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter76Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter76Value(string $parameter76Value): self + { + $this->options['parameter76Value'] = $parameter76Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter77Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter77Name(string $parameter77Name): self + { + $this->options['parameter77Name'] = $parameter77Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter77Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter77Value(string $parameter77Value): self + { + $this->options['parameter77Value'] = $parameter77Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter78Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter78Name(string $parameter78Name): self + { + $this->options['parameter78Name'] = $parameter78Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter78Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter78Value(string $parameter78Value): self + { + $this->options['parameter78Value'] = $parameter78Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter79Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter79Name(string $parameter79Name): self + { + $this->options['parameter79Name'] = $parameter79Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter79Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter79Value(string $parameter79Value): self + { + $this->options['parameter79Value'] = $parameter79Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter80Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter80Name(string $parameter80Name): self + { + $this->options['parameter80Name'] = $parameter80Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter80Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter80Value(string $parameter80Value): self + { + $this->options['parameter80Value'] = $parameter80Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter81Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter81Name(string $parameter81Name): self + { + $this->options['parameter81Name'] = $parameter81Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter81Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter81Value(string $parameter81Value): self + { + $this->options['parameter81Value'] = $parameter81Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter82Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter82Name(string $parameter82Name): self + { + $this->options['parameter82Name'] = $parameter82Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter82Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter82Value(string $parameter82Value): self + { + $this->options['parameter82Value'] = $parameter82Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter83Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter83Name(string $parameter83Name): self + { + $this->options['parameter83Name'] = $parameter83Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter83Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter83Value(string $parameter83Value): self + { + $this->options['parameter83Value'] = $parameter83Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter84Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter84Name(string $parameter84Name): self + { + $this->options['parameter84Name'] = $parameter84Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter84Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter84Value(string $parameter84Value): self + { + $this->options['parameter84Value'] = $parameter84Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter85Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter85Name(string $parameter85Name): self + { + $this->options['parameter85Name'] = $parameter85Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter85Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter85Value(string $parameter85Value): self + { + $this->options['parameter85Value'] = $parameter85Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter86Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter86Name(string $parameter86Name): self + { + $this->options['parameter86Name'] = $parameter86Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter86Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter86Value(string $parameter86Value): self + { + $this->options['parameter86Value'] = $parameter86Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter87Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter87Name(string $parameter87Name): self + { + $this->options['parameter87Name'] = $parameter87Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter87Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter87Value(string $parameter87Value): self + { + $this->options['parameter87Value'] = $parameter87Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter88Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter88Name(string $parameter88Name): self + { + $this->options['parameter88Name'] = $parameter88Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter88Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter88Value(string $parameter88Value): self + { + $this->options['parameter88Value'] = $parameter88Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter89Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter89Name(string $parameter89Name): self + { + $this->options['parameter89Name'] = $parameter89Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter89Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter89Value(string $parameter89Value): self + { + $this->options['parameter89Value'] = $parameter89Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter90Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter90Name(string $parameter90Name): self + { + $this->options['parameter90Name'] = $parameter90Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter90Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter90Value(string $parameter90Value): self + { + $this->options['parameter90Value'] = $parameter90Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter91Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter91Name(string $parameter91Name): self + { + $this->options['parameter91Name'] = $parameter91Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter91Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter91Value(string $parameter91Value): self + { + $this->options['parameter91Value'] = $parameter91Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter92Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter92Name(string $parameter92Name): self + { + $this->options['parameter92Name'] = $parameter92Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter92Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter92Value(string $parameter92Value): self + { + $this->options['parameter92Value'] = $parameter92Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter93Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter93Name(string $parameter93Name): self + { + $this->options['parameter93Name'] = $parameter93Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter93Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter93Value(string $parameter93Value): self + { + $this->options['parameter93Value'] = $parameter93Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter94Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter94Name(string $parameter94Name): self + { + $this->options['parameter94Name'] = $parameter94Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter94Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter94Value(string $parameter94Value): self + { + $this->options['parameter94Value'] = $parameter94Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter95Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter95Name(string $parameter95Name): self + { + $this->options['parameter95Name'] = $parameter95Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter95Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter95Value(string $parameter95Value): self + { + $this->options['parameter95Value'] = $parameter95Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter96Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter96Name(string $parameter96Name): self + { + $this->options['parameter96Name'] = $parameter96Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter96Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter96Value(string $parameter96Value): self + { + $this->options['parameter96Value'] = $parameter96Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter97Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter97Name(string $parameter97Name): self + { + $this->options['parameter97Name'] = $parameter97Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter97Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter97Value(string $parameter97Value): self + { + $this->options['parameter97Value'] = $parameter97Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter98Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter98Name(string $parameter98Name): self + { + $this->options['parameter98Name'] = $parameter98Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter98Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter98Value(string $parameter98Value): self + { + $this->options['parameter98Value'] = $parameter98Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter99Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter99Name(string $parameter99Name): self + { + $this->options['parameter99Name'] = $parameter99Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter99Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter99Value(string $parameter99Value): self + { + $this->options['parameter99Value'] = $parameter99Value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateSiprecOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php new file mode 100644 index 0000000..db07353 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SiprecInstance \Twilio\Rest\Api\V2010\Account\Call\SiprecInstance + */ + public function buildInstance(array $payload): SiprecInstance + { + return new SiprecInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SiprecPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php new file mode 100644 index 0000000..4925ea1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php @@ -0,0 +1,102 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Streams/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the StreamInstance + * + * @param string $status + * @return StreamInstance Updated StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): StreamInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new StreamInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.StreamContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php new file mode 100644 index 0000000..b8a73a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'name' => Values::array_get($payload, 'name'), + 'status' => Values::array_get($payload, 'status'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 StreamContext Context for this StreamInstance + */ + protected function proxy(): StreamContext + { + if (!$this->context) { + $this->context = new StreamContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the StreamInstance + * + * @param string $status + * @return StreamInstance Updated StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): StreamInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.StreamInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamList.php new file mode 100644 index 0000000..93123e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamList.php @@ -0,0 +1,519 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Streams.json'; + } + + /** + * Create the StreamInstance + * + * @param string $url Relative or absolute URL where WebSocket connection will be established. + * @param array|Options $options Optional Arguments + * @return StreamInstance Created StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $url, array $options = []): StreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $url, + 'Name' => + $options['name'], + 'Track' => + $options['track'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Parameter1.Name' => + $options['parameter1Name'], + 'Parameter1.Value' => + $options['parameter1Value'], + 'Parameter2.Name' => + $options['parameter2Name'], + 'Parameter2.Value' => + $options['parameter2Value'], + 'Parameter3.Name' => + $options['parameter3Name'], + 'Parameter3.Value' => + $options['parameter3Value'], + 'Parameter4.Name' => + $options['parameter4Name'], + 'Parameter4.Value' => + $options['parameter4Value'], + 'Parameter5.Name' => + $options['parameter5Name'], + 'Parameter5.Value' => + $options['parameter5Value'], + 'Parameter6.Name' => + $options['parameter6Name'], + 'Parameter6.Value' => + $options['parameter6Value'], + 'Parameter7.Name' => + $options['parameter7Name'], + 'Parameter7.Value' => + $options['parameter7Value'], + 'Parameter8.Name' => + $options['parameter8Name'], + 'Parameter8.Value' => + $options['parameter8Value'], + 'Parameter9.Name' => + $options['parameter9Name'], + 'Parameter9.Value' => + $options['parameter9Value'], + 'Parameter10.Name' => + $options['parameter10Name'], + 'Parameter10.Value' => + $options['parameter10Value'], + 'Parameter11.Name' => + $options['parameter11Name'], + 'Parameter11.Value' => + $options['parameter11Value'], + 'Parameter12.Name' => + $options['parameter12Name'], + 'Parameter12.Value' => + $options['parameter12Value'], + 'Parameter13.Name' => + $options['parameter13Name'], + 'Parameter13.Value' => + $options['parameter13Value'], + 'Parameter14.Name' => + $options['parameter14Name'], + 'Parameter14.Value' => + $options['parameter14Value'], + 'Parameter15.Name' => + $options['parameter15Name'], + 'Parameter15.Value' => + $options['parameter15Value'], + 'Parameter16.Name' => + $options['parameter16Name'], + 'Parameter16.Value' => + $options['parameter16Value'], + 'Parameter17.Name' => + $options['parameter17Name'], + 'Parameter17.Value' => + $options['parameter17Value'], + 'Parameter18.Name' => + $options['parameter18Name'], + 'Parameter18.Value' => + $options['parameter18Value'], + 'Parameter19.Name' => + $options['parameter19Name'], + 'Parameter19.Value' => + $options['parameter19Value'], + 'Parameter20.Name' => + $options['parameter20Name'], + 'Parameter20.Value' => + $options['parameter20Value'], + 'Parameter21.Name' => + $options['parameter21Name'], + 'Parameter21.Value' => + $options['parameter21Value'], + 'Parameter22.Name' => + $options['parameter22Name'], + 'Parameter22.Value' => + $options['parameter22Value'], + 'Parameter23.Name' => + $options['parameter23Name'], + 'Parameter23.Value' => + $options['parameter23Value'], + 'Parameter24.Name' => + $options['parameter24Name'], + 'Parameter24.Value' => + $options['parameter24Value'], + 'Parameter25.Name' => + $options['parameter25Name'], + 'Parameter25.Value' => + $options['parameter25Value'], + 'Parameter26.Name' => + $options['parameter26Name'], + 'Parameter26.Value' => + $options['parameter26Value'], + 'Parameter27.Name' => + $options['parameter27Name'], + 'Parameter27.Value' => + $options['parameter27Value'], + 'Parameter28.Name' => + $options['parameter28Name'], + 'Parameter28.Value' => + $options['parameter28Value'], + 'Parameter29.Name' => + $options['parameter29Name'], + 'Parameter29.Value' => + $options['parameter29Value'], + 'Parameter30.Name' => + $options['parameter30Name'], + 'Parameter30.Value' => + $options['parameter30Value'], + 'Parameter31.Name' => + $options['parameter31Name'], + 'Parameter31.Value' => + $options['parameter31Value'], + 'Parameter32.Name' => + $options['parameter32Name'], + 'Parameter32.Value' => + $options['parameter32Value'], + 'Parameter33.Name' => + $options['parameter33Name'], + 'Parameter33.Value' => + $options['parameter33Value'], + 'Parameter34.Name' => + $options['parameter34Name'], + 'Parameter34.Value' => + $options['parameter34Value'], + 'Parameter35.Name' => + $options['parameter35Name'], + 'Parameter35.Value' => + $options['parameter35Value'], + 'Parameter36.Name' => + $options['parameter36Name'], + 'Parameter36.Value' => + $options['parameter36Value'], + 'Parameter37.Name' => + $options['parameter37Name'], + 'Parameter37.Value' => + $options['parameter37Value'], + 'Parameter38.Name' => + $options['parameter38Name'], + 'Parameter38.Value' => + $options['parameter38Value'], + 'Parameter39.Name' => + $options['parameter39Name'], + 'Parameter39.Value' => + $options['parameter39Value'], + 'Parameter40.Name' => + $options['parameter40Name'], + 'Parameter40.Value' => + $options['parameter40Value'], + 'Parameter41.Name' => + $options['parameter41Name'], + 'Parameter41.Value' => + $options['parameter41Value'], + 'Parameter42.Name' => + $options['parameter42Name'], + 'Parameter42.Value' => + $options['parameter42Value'], + 'Parameter43.Name' => + $options['parameter43Name'], + 'Parameter43.Value' => + $options['parameter43Value'], + 'Parameter44.Name' => + $options['parameter44Name'], + 'Parameter44.Value' => + $options['parameter44Value'], + 'Parameter45.Name' => + $options['parameter45Name'], + 'Parameter45.Value' => + $options['parameter45Value'], + 'Parameter46.Name' => + $options['parameter46Name'], + 'Parameter46.Value' => + $options['parameter46Value'], + 'Parameter47.Name' => + $options['parameter47Name'], + 'Parameter47.Value' => + $options['parameter47Value'], + 'Parameter48.Name' => + $options['parameter48Name'], + 'Parameter48.Value' => + $options['parameter48Value'], + 'Parameter49.Name' => + $options['parameter49Name'], + 'Parameter49.Value' => + $options['parameter49Value'], + 'Parameter50.Name' => + $options['parameter50Name'], + 'Parameter50.Value' => + $options['parameter50Value'], + 'Parameter51.Name' => + $options['parameter51Name'], + 'Parameter51.Value' => + $options['parameter51Value'], + 'Parameter52.Name' => + $options['parameter52Name'], + 'Parameter52.Value' => + $options['parameter52Value'], + 'Parameter53.Name' => + $options['parameter53Name'], + 'Parameter53.Value' => + $options['parameter53Value'], + 'Parameter54.Name' => + $options['parameter54Name'], + 'Parameter54.Value' => + $options['parameter54Value'], + 'Parameter55.Name' => + $options['parameter55Name'], + 'Parameter55.Value' => + $options['parameter55Value'], + 'Parameter56.Name' => + $options['parameter56Name'], + 'Parameter56.Value' => + $options['parameter56Value'], + 'Parameter57.Name' => + $options['parameter57Name'], + 'Parameter57.Value' => + $options['parameter57Value'], + 'Parameter58.Name' => + $options['parameter58Name'], + 'Parameter58.Value' => + $options['parameter58Value'], + 'Parameter59.Name' => + $options['parameter59Name'], + 'Parameter59.Value' => + $options['parameter59Value'], + 'Parameter60.Name' => + $options['parameter60Name'], + 'Parameter60.Value' => + $options['parameter60Value'], + 'Parameter61.Name' => + $options['parameter61Name'], + 'Parameter61.Value' => + $options['parameter61Value'], + 'Parameter62.Name' => + $options['parameter62Name'], + 'Parameter62.Value' => + $options['parameter62Value'], + 'Parameter63.Name' => + $options['parameter63Name'], + 'Parameter63.Value' => + $options['parameter63Value'], + 'Parameter64.Name' => + $options['parameter64Name'], + 'Parameter64.Value' => + $options['parameter64Value'], + 'Parameter65.Name' => + $options['parameter65Name'], + 'Parameter65.Value' => + $options['parameter65Value'], + 'Parameter66.Name' => + $options['parameter66Name'], + 'Parameter66.Value' => + $options['parameter66Value'], + 'Parameter67.Name' => + $options['parameter67Name'], + 'Parameter67.Value' => + $options['parameter67Value'], + 'Parameter68.Name' => + $options['parameter68Name'], + 'Parameter68.Value' => + $options['parameter68Value'], + 'Parameter69.Name' => + $options['parameter69Name'], + 'Parameter69.Value' => + $options['parameter69Value'], + 'Parameter70.Name' => + $options['parameter70Name'], + 'Parameter70.Value' => + $options['parameter70Value'], + 'Parameter71.Name' => + $options['parameter71Name'], + 'Parameter71.Value' => + $options['parameter71Value'], + 'Parameter72.Name' => + $options['parameter72Name'], + 'Parameter72.Value' => + $options['parameter72Value'], + 'Parameter73.Name' => + $options['parameter73Name'], + 'Parameter73.Value' => + $options['parameter73Value'], + 'Parameter74.Name' => + $options['parameter74Name'], + 'Parameter74.Value' => + $options['parameter74Value'], + 'Parameter75.Name' => + $options['parameter75Name'], + 'Parameter75.Value' => + $options['parameter75Value'], + 'Parameter76.Name' => + $options['parameter76Name'], + 'Parameter76.Value' => + $options['parameter76Value'], + 'Parameter77.Name' => + $options['parameter77Name'], + 'Parameter77.Value' => + $options['parameter77Value'], + 'Parameter78.Name' => + $options['parameter78Name'], + 'Parameter78.Value' => + $options['parameter78Value'], + 'Parameter79.Name' => + $options['parameter79Name'], + 'Parameter79.Value' => + $options['parameter79Value'], + 'Parameter80.Name' => + $options['parameter80Name'], + 'Parameter80.Value' => + $options['parameter80Value'], + 'Parameter81.Name' => + $options['parameter81Name'], + 'Parameter81.Value' => + $options['parameter81Value'], + 'Parameter82.Name' => + $options['parameter82Name'], + 'Parameter82.Value' => + $options['parameter82Value'], + 'Parameter83.Name' => + $options['parameter83Name'], + 'Parameter83.Value' => + $options['parameter83Value'], + 'Parameter84.Name' => + $options['parameter84Name'], + 'Parameter84.Value' => + $options['parameter84Value'], + 'Parameter85.Name' => + $options['parameter85Name'], + 'Parameter85.Value' => + $options['parameter85Value'], + 'Parameter86.Name' => + $options['parameter86Name'], + 'Parameter86.Value' => + $options['parameter86Value'], + 'Parameter87.Name' => + $options['parameter87Name'], + 'Parameter87.Value' => + $options['parameter87Value'], + 'Parameter88.Name' => + $options['parameter88Name'], + 'Parameter88.Value' => + $options['parameter88Value'], + 'Parameter89.Name' => + $options['parameter89Name'], + 'Parameter89.Value' => + $options['parameter89Value'], + 'Parameter90.Name' => + $options['parameter90Name'], + 'Parameter90.Value' => + $options['parameter90Value'], + 'Parameter91.Name' => + $options['parameter91Name'], + 'Parameter91.Value' => + $options['parameter91Value'], + 'Parameter92.Name' => + $options['parameter92Name'], + 'Parameter92.Value' => + $options['parameter92Value'], + 'Parameter93.Name' => + $options['parameter93Name'], + 'Parameter93.Value' => + $options['parameter93Value'], + 'Parameter94.Name' => + $options['parameter94Name'], + 'Parameter94.Value' => + $options['parameter94Value'], + 'Parameter95.Name' => + $options['parameter95Name'], + 'Parameter95.Value' => + $options['parameter95Value'], + 'Parameter96.Name' => + $options['parameter96Name'], + 'Parameter96.Value' => + $options['parameter96Value'], + 'Parameter97.Name' => + $options['parameter97Name'], + 'Parameter97.Value' => + $options['parameter97Value'], + 'Parameter98.Name' => + $options['parameter98Name'], + 'Parameter98.Value' => + $options['parameter98Value'], + 'Parameter99.Name' => + $options['parameter99Name'], + 'Parameter99.Value' => + $options['parameter99Value'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new StreamInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a StreamContext + * + * @param string $sid The SID or the `name` of the Stream resource to be stopped + */ + public function getContext( + string $sid + + ): StreamContext + { + return new StreamContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.StreamList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php new file mode 100644 index 0000000..03ee992 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php @@ -0,0 +1,3695 @@ +options['name'] = $name; + $this->options['track'] = $track; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['parameter1Name'] = $parameter1Name; + $this->options['parameter1Value'] = $parameter1Value; + $this->options['parameter2Name'] = $parameter2Name; + $this->options['parameter2Value'] = $parameter2Value; + $this->options['parameter3Name'] = $parameter3Name; + $this->options['parameter3Value'] = $parameter3Value; + $this->options['parameter4Name'] = $parameter4Name; + $this->options['parameter4Value'] = $parameter4Value; + $this->options['parameter5Name'] = $parameter5Name; + $this->options['parameter5Value'] = $parameter5Value; + $this->options['parameter6Name'] = $parameter6Name; + $this->options['parameter6Value'] = $parameter6Value; + $this->options['parameter7Name'] = $parameter7Name; + $this->options['parameter7Value'] = $parameter7Value; + $this->options['parameter8Name'] = $parameter8Name; + $this->options['parameter8Value'] = $parameter8Value; + $this->options['parameter9Name'] = $parameter9Name; + $this->options['parameter9Value'] = $parameter9Value; + $this->options['parameter10Name'] = $parameter10Name; + $this->options['parameter10Value'] = $parameter10Value; + $this->options['parameter11Name'] = $parameter11Name; + $this->options['parameter11Value'] = $parameter11Value; + $this->options['parameter12Name'] = $parameter12Name; + $this->options['parameter12Value'] = $parameter12Value; + $this->options['parameter13Name'] = $parameter13Name; + $this->options['parameter13Value'] = $parameter13Value; + $this->options['parameter14Name'] = $parameter14Name; + $this->options['parameter14Value'] = $parameter14Value; + $this->options['parameter15Name'] = $parameter15Name; + $this->options['parameter15Value'] = $parameter15Value; + $this->options['parameter16Name'] = $parameter16Name; + $this->options['parameter16Value'] = $parameter16Value; + $this->options['parameter17Name'] = $parameter17Name; + $this->options['parameter17Value'] = $parameter17Value; + $this->options['parameter18Name'] = $parameter18Name; + $this->options['parameter18Value'] = $parameter18Value; + $this->options['parameter19Name'] = $parameter19Name; + $this->options['parameter19Value'] = $parameter19Value; + $this->options['parameter20Name'] = $parameter20Name; + $this->options['parameter20Value'] = $parameter20Value; + $this->options['parameter21Name'] = $parameter21Name; + $this->options['parameter21Value'] = $parameter21Value; + $this->options['parameter22Name'] = $parameter22Name; + $this->options['parameter22Value'] = $parameter22Value; + $this->options['parameter23Name'] = $parameter23Name; + $this->options['parameter23Value'] = $parameter23Value; + $this->options['parameter24Name'] = $parameter24Name; + $this->options['parameter24Value'] = $parameter24Value; + $this->options['parameter25Name'] = $parameter25Name; + $this->options['parameter25Value'] = $parameter25Value; + $this->options['parameter26Name'] = $parameter26Name; + $this->options['parameter26Value'] = $parameter26Value; + $this->options['parameter27Name'] = $parameter27Name; + $this->options['parameter27Value'] = $parameter27Value; + $this->options['parameter28Name'] = $parameter28Name; + $this->options['parameter28Value'] = $parameter28Value; + $this->options['parameter29Name'] = $parameter29Name; + $this->options['parameter29Value'] = $parameter29Value; + $this->options['parameter30Name'] = $parameter30Name; + $this->options['parameter30Value'] = $parameter30Value; + $this->options['parameter31Name'] = $parameter31Name; + $this->options['parameter31Value'] = $parameter31Value; + $this->options['parameter32Name'] = $parameter32Name; + $this->options['parameter32Value'] = $parameter32Value; + $this->options['parameter33Name'] = $parameter33Name; + $this->options['parameter33Value'] = $parameter33Value; + $this->options['parameter34Name'] = $parameter34Name; + $this->options['parameter34Value'] = $parameter34Value; + $this->options['parameter35Name'] = $parameter35Name; + $this->options['parameter35Value'] = $parameter35Value; + $this->options['parameter36Name'] = $parameter36Name; + $this->options['parameter36Value'] = $parameter36Value; + $this->options['parameter37Name'] = $parameter37Name; + $this->options['parameter37Value'] = $parameter37Value; + $this->options['parameter38Name'] = $parameter38Name; + $this->options['parameter38Value'] = $parameter38Value; + $this->options['parameter39Name'] = $parameter39Name; + $this->options['parameter39Value'] = $parameter39Value; + $this->options['parameter40Name'] = $parameter40Name; + $this->options['parameter40Value'] = $parameter40Value; + $this->options['parameter41Name'] = $parameter41Name; + $this->options['parameter41Value'] = $parameter41Value; + $this->options['parameter42Name'] = $parameter42Name; + $this->options['parameter42Value'] = $parameter42Value; + $this->options['parameter43Name'] = $parameter43Name; + $this->options['parameter43Value'] = $parameter43Value; + $this->options['parameter44Name'] = $parameter44Name; + $this->options['parameter44Value'] = $parameter44Value; + $this->options['parameter45Name'] = $parameter45Name; + $this->options['parameter45Value'] = $parameter45Value; + $this->options['parameter46Name'] = $parameter46Name; + $this->options['parameter46Value'] = $parameter46Value; + $this->options['parameter47Name'] = $parameter47Name; + $this->options['parameter47Value'] = $parameter47Value; + $this->options['parameter48Name'] = $parameter48Name; + $this->options['parameter48Value'] = $parameter48Value; + $this->options['parameter49Name'] = $parameter49Name; + $this->options['parameter49Value'] = $parameter49Value; + $this->options['parameter50Name'] = $parameter50Name; + $this->options['parameter50Value'] = $parameter50Value; + $this->options['parameter51Name'] = $parameter51Name; + $this->options['parameter51Value'] = $parameter51Value; + $this->options['parameter52Name'] = $parameter52Name; + $this->options['parameter52Value'] = $parameter52Value; + $this->options['parameter53Name'] = $parameter53Name; + $this->options['parameter53Value'] = $parameter53Value; + $this->options['parameter54Name'] = $parameter54Name; + $this->options['parameter54Value'] = $parameter54Value; + $this->options['parameter55Name'] = $parameter55Name; + $this->options['parameter55Value'] = $parameter55Value; + $this->options['parameter56Name'] = $parameter56Name; + $this->options['parameter56Value'] = $parameter56Value; + $this->options['parameter57Name'] = $parameter57Name; + $this->options['parameter57Value'] = $parameter57Value; + $this->options['parameter58Name'] = $parameter58Name; + $this->options['parameter58Value'] = $parameter58Value; + $this->options['parameter59Name'] = $parameter59Name; + $this->options['parameter59Value'] = $parameter59Value; + $this->options['parameter60Name'] = $parameter60Name; + $this->options['parameter60Value'] = $parameter60Value; + $this->options['parameter61Name'] = $parameter61Name; + $this->options['parameter61Value'] = $parameter61Value; + $this->options['parameter62Name'] = $parameter62Name; + $this->options['parameter62Value'] = $parameter62Value; + $this->options['parameter63Name'] = $parameter63Name; + $this->options['parameter63Value'] = $parameter63Value; + $this->options['parameter64Name'] = $parameter64Name; + $this->options['parameter64Value'] = $parameter64Value; + $this->options['parameter65Name'] = $parameter65Name; + $this->options['parameter65Value'] = $parameter65Value; + $this->options['parameter66Name'] = $parameter66Name; + $this->options['parameter66Value'] = $parameter66Value; + $this->options['parameter67Name'] = $parameter67Name; + $this->options['parameter67Value'] = $parameter67Value; + $this->options['parameter68Name'] = $parameter68Name; + $this->options['parameter68Value'] = $parameter68Value; + $this->options['parameter69Name'] = $parameter69Name; + $this->options['parameter69Value'] = $parameter69Value; + $this->options['parameter70Name'] = $parameter70Name; + $this->options['parameter70Value'] = $parameter70Value; + $this->options['parameter71Name'] = $parameter71Name; + $this->options['parameter71Value'] = $parameter71Value; + $this->options['parameter72Name'] = $parameter72Name; + $this->options['parameter72Value'] = $parameter72Value; + $this->options['parameter73Name'] = $parameter73Name; + $this->options['parameter73Value'] = $parameter73Value; + $this->options['parameter74Name'] = $parameter74Name; + $this->options['parameter74Value'] = $parameter74Value; + $this->options['parameter75Name'] = $parameter75Name; + $this->options['parameter75Value'] = $parameter75Value; + $this->options['parameter76Name'] = $parameter76Name; + $this->options['parameter76Value'] = $parameter76Value; + $this->options['parameter77Name'] = $parameter77Name; + $this->options['parameter77Value'] = $parameter77Value; + $this->options['parameter78Name'] = $parameter78Name; + $this->options['parameter78Value'] = $parameter78Value; + $this->options['parameter79Name'] = $parameter79Name; + $this->options['parameter79Value'] = $parameter79Value; + $this->options['parameter80Name'] = $parameter80Name; + $this->options['parameter80Value'] = $parameter80Value; + $this->options['parameter81Name'] = $parameter81Name; + $this->options['parameter81Value'] = $parameter81Value; + $this->options['parameter82Name'] = $parameter82Name; + $this->options['parameter82Value'] = $parameter82Value; + $this->options['parameter83Name'] = $parameter83Name; + $this->options['parameter83Value'] = $parameter83Value; + $this->options['parameter84Name'] = $parameter84Name; + $this->options['parameter84Value'] = $parameter84Value; + $this->options['parameter85Name'] = $parameter85Name; + $this->options['parameter85Value'] = $parameter85Value; + $this->options['parameter86Name'] = $parameter86Name; + $this->options['parameter86Value'] = $parameter86Value; + $this->options['parameter87Name'] = $parameter87Name; + $this->options['parameter87Value'] = $parameter87Value; + $this->options['parameter88Name'] = $parameter88Name; + $this->options['parameter88Value'] = $parameter88Value; + $this->options['parameter89Name'] = $parameter89Name; + $this->options['parameter89Value'] = $parameter89Value; + $this->options['parameter90Name'] = $parameter90Name; + $this->options['parameter90Value'] = $parameter90Value; + $this->options['parameter91Name'] = $parameter91Name; + $this->options['parameter91Value'] = $parameter91Value; + $this->options['parameter92Name'] = $parameter92Name; + $this->options['parameter92Value'] = $parameter92Value; + $this->options['parameter93Name'] = $parameter93Name; + $this->options['parameter93Value'] = $parameter93Value; + $this->options['parameter94Name'] = $parameter94Name; + $this->options['parameter94Value'] = $parameter94Value; + $this->options['parameter95Name'] = $parameter95Name; + $this->options['parameter95Value'] = $parameter95Value; + $this->options['parameter96Name'] = $parameter96Name; + $this->options['parameter96Value'] = $parameter96Value; + $this->options['parameter97Name'] = $parameter97Name; + $this->options['parameter97Value'] = $parameter97Value; + $this->options['parameter98Name'] = $parameter98Name; + $this->options['parameter98Value'] = $parameter98Value; + $this->options['parameter99Name'] = $parameter99Name; + $this->options['parameter99Value'] = $parameter99Value; + } + + /** + * The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. + * + * @param string $name The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * @param string $track + * @return $this Fluent Builder + */ + public function setTrack(string $track): self + { + $this->options['track'] = $track; + return $this; + } + + /** + * Absolute URL to which Twilio sends status callback HTTP requests. + * + * @param string $statusCallback Absolute URL to which Twilio sends status callback HTTP requests. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method Twilio uses when sending `status_callback` requests. Possible values are `GET` and `POST`. Default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method Twilio uses when sending `status_callback` requests. Possible values are `GET` and `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter1Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter1Name(string $parameter1Name): self + { + $this->options['parameter1Name'] = $parameter1Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter1Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter1Value(string $parameter1Value): self + { + $this->options['parameter1Value'] = $parameter1Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter2Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter2Name(string $parameter2Name): self + { + $this->options['parameter2Name'] = $parameter2Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter2Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter2Value(string $parameter2Value): self + { + $this->options['parameter2Value'] = $parameter2Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter3Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter3Name(string $parameter3Name): self + { + $this->options['parameter3Name'] = $parameter3Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter3Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter3Value(string $parameter3Value): self + { + $this->options['parameter3Value'] = $parameter3Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter4Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter4Name(string $parameter4Name): self + { + $this->options['parameter4Name'] = $parameter4Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter4Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter4Value(string $parameter4Value): self + { + $this->options['parameter4Value'] = $parameter4Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter5Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter5Name(string $parameter5Name): self + { + $this->options['parameter5Name'] = $parameter5Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter5Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter5Value(string $parameter5Value): self + { + $this->options['parameter5Value'] = $parameter5Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter6Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter6Name(string $parameter6Name): self + { + $this->options['parameter6Name'] = $parameter6Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter6Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter6Value(string $parameter6Value): self + { + $this->options['parameter6Value'] = $parameter6Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter7Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter7Name(string $parameter7Name): self + { + $this->options['parameter7Name'] = $parameter7Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter7Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter7Value(string $parameter7Value): self + { + $this->options['parameter7Value'] = $parameter7Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter8Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter8Name(string $parameter8Name): self + { + $this->options['parameter8Name'] = $parameter8Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter8Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter8Value(string $parameter8Value): self + { + $this->options['parameter8Value'] = $parameter8Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter9Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter9Name(string $parameter9Name): self + { + $this->options['parameter9Name'] = $parameter9Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter9Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter9Value(string $parameter9Value): self + { + $this->options['parameter9Value'] = $parameter9Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter10Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter10Name(string $parameter10Name): self + { + $this->options['parameter10Name'] = $parameter10Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter10Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter10Value(string $parameter10Value): self + { + $this->options['parameter10Value'] = $parameter10Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter11Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter11Name(string $parameter11Name): self + { + $this->options['parameter11Name'] = $parameter11Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter11Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter11Value(string $parameter11Value): self + { + $this->options['parameter11Value'] = $parameter11Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter12Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter12Name(string $parameter12Name): self + { + $this->options['parameter12Name'] = $parameter12Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter12Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter12Value(string $parameter12Value): self + { + $this->options['parameter12Value'] = $parameter12Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter13Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter13Name(string $parameter13Name): self + { + $this->options['parameter13Name'] = $parameter13Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter13Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter13Value(string $parameter13Value): self + { + $this->options['parameter13Value'] = $parameter13Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter14Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter14Name(string $parameter14Name): self + { + $this->options['parameter14Name'] = $parameter14Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter14Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter14Value(string $parameter14Value): self + { + $this->options['parameter14Value'] = $parameter14Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter15Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter15Name(string $parameter15Name): self + { + $this->options['parameter15Name'] = $parameter15Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter15Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter15Value(string $parameter15Value): self + { + $this->options['parameter15Value'] = $parameter15Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter16Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter16Name(string $parameter16Name): self + { + $this->options['parameter16Name'] = $parameter16Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter16Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter16Value(string $parameter16Value): self + { + $this->options['parameter16Value'] = $parameter16Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter17Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter17Name(string $parameter17Name): self + { + $this->options['parameter17Name'] = $parameter17Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter17Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter17Value(string $parameter17Value): self + { + $this->options['parameter17Value'] = $parameter17Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter18Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter18Name(string $parameter18Name): self + { + $this->options['parameter18Name'] = $parameter18Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter18Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter18Value(string $parameter18Value): self + { + $this->options['parameter18Value'] = $parameter18Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter19Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter19Name(string $parameter19Name): self + { + $this->options['parameter19Name'] = $parameter19Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter19Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter19Value(string $parameter19Value): self + { + $this->options['parameter19Value'] = $parameter19Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter20Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter20Name(string $parameter20Name): self + { + $this->options['parameter20Name'] = $parameter20Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter20Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter20Value(string $parameter20Value): self + { + $this->options['parameter20Value'] = $parameter20Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter21Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter21Name(string $parameter21Name): self + { + $this->options['parameter21Name'] = $parameter21Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter21Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter21Value(string $parameter21Value): self + { + $this->options['parameter21Value'] = $parameter21Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter22Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter22Name(string $parameter22Name): self + { + $this->options['parameter22Name'] = $parameter22Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter22Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter22Value(string $parameter22Value): self + { + $this->options['parameter22Value'] = $parameter22Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter23Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter23Name(string $parameter23Name): self + { + $this->options['parameter23Name'] = $parameter23Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter23Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter23Value(string $parameter23Value): self + { + $this->options['parameter23Value'] = $parameter23Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter24Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter24Name(string $parameter24Name): self + { + $this->options['parameter24Name'] = $parameter24Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter24Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter24Value(string $parameter24Value): self + { + $this->options['parameter24Value'] = $parameter24Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter25Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter25Name(string $parameter25Name): self + { + $this->options['parameter25Name'] = $parameter25Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter25Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter25Value(string $parameter25Value): self + { + $this->options['parameter25Value'] = $parameter25Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter26Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter26Name(string $parameter26Name): self + { + $this->options['parameter26Name'] = $parameter26Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter26Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter26Value(string $parameter26Value): self + { + $this->options['parameter26Value'] = $parameter26Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter27Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter27Name(string $parameter27Name): self + { + $this->options['parameter27Name'] = $parameter27Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter27Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter27Value(string $parameter27Value): self + { + $this->options['parameter27Value'] = $parameter27Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter28Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter28Name(string $parameter28Name): self + { + $this->options['parameter28Name'] = $parameter28Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter28Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter28Value(string $parameter28Value): self + { + $this->options['parameter28Value'] = $parameter28Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter29Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter29Name(string $parameter29Name): self + { + $this->options['parameter29Name'] = $parameter29Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter29Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter29Value(string $parameter29Value): self + { + $this->options['parameter29Value'] = $parameter29Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter30Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter30Name(string $parameter30Name): self + { + $this->options['parameter30Name'] = $parameter30Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter30Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter30Value(string $parameter30Value): self + { + $this->options['parameter30Value'] = $parameter30Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter31Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter31Name(string $parameter31Name): self + { + $this->options['parameter31Name'] = $parameter31Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter31Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter31Value(string $parameter31Value): self + { + $this->options['parameter31Value'] = $parameter31Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter32Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter32Name(string $parameter32Name): self + { + $this->options['parameter32Name'] = $parameter32Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter32Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter32Value(string $parameter32Value): self + { + $this->options['parameter32Value'] = $parameter32Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter33Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter33Name(string $parameter33Name): self + { + $this->options['parameter33Name'] = $parameter33Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter33Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter33Value(string $parameter33Value): self + { + $this->options['parameter33Value'] = $parameter33Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter34Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter34Name(string $parameter34Name): self + { + $this->options['parameter34Name'] = $parameter34Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter34Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter34Value(string $parameter34Value): self + { + $this->options['parameter34Value'] = $parameter34Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter35Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter35Name(string $parameter35Name): self + { + $this->options['parameter35Name'] = $parameter35Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter35Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter35Value(string $parameter35Value): self + { + $this->options['parameter35Value'] = $parameter35Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter36Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter36Name(string $parameter36Name): self + { + $this->options['parameter36Name'] = $parameter36Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter36Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter36Value(string $parameter36Value): self + { + $this->options['parameter36Value'] = $parameter36Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter37Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter37Name(string $parameter37Name): self + { + $this->options['parameter37Name'] = $parameter37Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter37Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter37Value(string $parameter37Value): self + { + $this->options['parameter37Value'] = $parameter37Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter38Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter38Name(string $parameter38Name): self + { + $this->options['parameter38Name'] = $parameter38Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter38Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter38Value(string $parameter38Value): self + { + $this->options['parameter38Value'] = $parameter38Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter39Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter39Name(string $parameter39Name): self + { + $this->options['parameter39Name'] = $parameter39Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter39Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter39Value(string $parameter39Value): self + { + $this->options['parameter39Value'] = $parameter39Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter40Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter40Name(string $parameter40Name): self + { + $this->options['parameter40Name'] = $parameter40Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter40Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter40Value(string $parameter40Value): self + { + $this->options['parameter40Value'] = $parameter40Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter41Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter41Name(string $parameter41Name): self + { + $this->options['parameter41Name'] = $parameter41Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter41Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter41Value(string $parameter41Value): self + { + $this->options['parameter41Value'] = $parameter41Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter42Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter42Name(string $parameter42Name): self + { + $this->options['parameter42Name'] = $parameter42Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter42Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter42Value(string $parameter42Value): self + { + $this->options['parameter42Value'] = $parameter42Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter43Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter43Name(string $parameter43Name): self + { + $this->options['parameter43Name'] = $parameter43Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter43Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter43Value(string $parameter43Value): self + { + $this->options['parameter43Value'] = $parameter43Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter44Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter44Name(string $parameter44Name): self + { + $this->options['parameter44Name'] = $parameter44Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter44Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter44Value(string $parameter44Value): self + { + $this->options['parameter44Value'] = $parameter44Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter45Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter45Name(string $parameter45Name): self + { + $this->options['parameter45Name'] = $parameter45Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter45Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter45Value(string $parameter45Value): self + { + $this->options['parameter45Value'] = $parameter45Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter46Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter46Name(string $parameter46Name): self + { + $this->options['parameter46Name'] = $parameter46Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter46Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter46Value(string $parameter46Value): self + { + $this->options['parameter46Value'] = $parameter46Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter47Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter47Name(string $parameter47Name): self + { + $this->options['parameter47Name'] = $parameter47Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter47Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter47Value(string $parameter47Value): self + { + $this->options['parameter47Value'] = $parameter47Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter48Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter48Name(string $parameter48Name): self + { + $this->options['parameter48Name'] = $parameter48Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter48Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter48Value(string $parameter48Value): self + { + $this->options['parameter48Value'] = $parameter48Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter49Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter49Name(string $parameter49Name): self + { + $this->options['parameter49Name'] = $parameter49Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter49Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter49Value(string $parameter49Value): self + { + $this->options['parameter49Value'] = $parameter49Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter50Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter50Name(string $parameter50Name): self + { + $this->options['parameter50Name'] = $parameter50Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter50Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter50Value(string $parameter50Value): self + { + $this->options['parameter50Value'] = $parameter50Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter51Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter51Name(string $parameter51Name): self + { + $this->options['parameter51Name'] = $parameter51Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter51Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter51Value(string $parameter51Value): self + { + $this->options['parameter51Value'] = $parameter51Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter52Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter52Name(string $parameter52Name): self + { + $this->options['parameter52Name'] = $parameter52Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter52Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter52Value(string $parameter52Value): self + { + $this->options['parameter52Value'] = $parameter52Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter53Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter53Name(string $parameter53Name): self + { + $this->options['parameter53Name'] = $parameter53Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter53Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter53Value(string $parameter53Value): self + { + $this->options['parameter53Value'] = $parameter53Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter54Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter54Name(string $parameter54Name): self + { + $this->options['parameter54Name'] = $parameter54Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter54Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter54Value(string $parameter54Value): self + { + $this->options['parameter54Value'] = $parameter54Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter55Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter55Name(string $parameter55Name): self + { + $this->options['parameter55Name'] = $parameter55Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter55Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter55Value(string $parameter55Value): self + { + $this->options['parameter55Value'] = $parameter55Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter56Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter56Name(string $parameter56Name): self + { + $this->options['parameter56Name'] = $parameter56Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter56Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter56Value(string $parameter56Value): self + { + $this->options['parameter56Value'] = $parameter56Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter57Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter57Name(string $parameter57Name): self + { + $this->options['parameter57Name'] = $parameter57Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter57Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter57Value(string $parameter57Value): self + { + $this->options['parameter57Value'] = $parameter57Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter58Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter58Name(string $parameter58Name): self + { + $this->options['parameter58Name'] = $parameter58Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter58Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter58Value(string $parameter58Value): self + { + $this->options['parameter58Value'] = $parameter58Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter59Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter59Name(string $parameter59Name): self + { + $this->options['parameter59Name'] = $parameter59Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter59Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter59Value(string $parameter59Value): self + { + $this->options['parameter59Value'] = $parameter59Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter60Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter60Name(string $parameter60Name): self + { + $this->options['parameter60Name'] = $parameter60Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter60Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter60Value(string $parameter60Value): self + { + $this->options['parameter60Value'] = $parameter60Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter61Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter61Name(string $parameter61Name): self + { + $this->options['parameter61Name'] = $parameter61Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter61Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter61Value(string $parameter61Value): self + { + $this->options['parameter61Value'] = $parameter61Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter62Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter62Name(string $parameter62Name): self + { + $this->options['parameter62Name'] = $parameter62Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter62Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter62Value(string $parameter62Value): self + { + $this->options['parameter62Value'] = $parameter62Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter63Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter63Name(string $parameter63Name): self + { + $this->options['parameter63Name'] = $parameter63Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter63Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter63Value(string $parameter63Value): self + { + $this->options['parameter63Value'] = $parameter63Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter64Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter64Name(string $parameter64Name): self + { + $this->options['parameter64Name'] = $parameter64Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter64Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter64Value(string $parameter64Value): self + { + $this->options['parameter64Value'] = $parameter64Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter65Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter65Name(string $parameter65Name): self + { + $this->options['parameter65Name'] = $parameter65Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter65Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter65Value(string $parameter65Value): self + { + $this->options['parameter65Value'] = $parameter65Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter66Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter66Name(string $parameter66Name): self + { + $this->options['parameter66Name'] = $parameter66Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter66Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter66Value(string $parameter66Value): self + { + $this->options['parameter66Value'] = $parameter66Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter67Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter67Name(string $parameter67Name): self + { + $this->options['parameter67Name'] = $parameter67Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter67Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter67Value(string $parameter67Value): self + { + $this->options['parameter67Value'] = $parameter67Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter68Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter68Name(string $parameter68Name): self + { + $this->options['parameter68Name'] = $parameter68Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter68Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter68Value(string $parameter68Value): self + { + $this->options['parameter68Value'] = $parameter68Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter69Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter69Name(string $parameter69Name): self + { + $this->options['parameter69Name'] = $parameter69Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter69Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter69Value(string $parameter69Value): self + { + $this->options['parameter69Value'] = $parameter69Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter70Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter70Name(string $parameter70Name): self + { + $this->options['parameter70Name'] = $parameter70Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter70Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter70Value(string $parameter70Value): self + { + $this->options['parameter70Value'] = $parameter70Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter71Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter71Name(string $parameter71Name): self + { + $this->options['parameter71Name'] = $parameter71Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter71Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter71Value(string $parameter71Value): self + { + $this->options['parameter71Value'] = $parameter71Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter72Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter72Name(string $parameter72Name): self + { + $this->options['parameter72Name'] = $parameter72Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter72Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter72Value(string $parameter72Value): self + { + $this->options['parameter72Value'] = $parameter72Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter73Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter73Name(string $parameter73Name): self + { + $this->options['parameter73Name'] = $parameter73Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter73Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter73Value(string $parameter73Value): self + { + $this->options['parameter73Value'] = $parameter73Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter74Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter74Name(string $parameter74Name): self + { + $this->options['parameter74Name'] = $parameter74Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter74Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter74Value(string $parameter74Value): self + { + $this->options['parameter74Value'] = $parameter74Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter75Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter75Name(string $parameter75Name): self + { + $this->options['parameter75Name'] = $parameter75Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter75Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter75Value(string $parameter75Value): self + { + $this->options['parameter75Value'] = $parameter75Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter76Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter76Name(string $parameter76Name): self + { + $this->options['parameter76Name'] = $parameter76Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter76Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter76Value(string $parameter76Value): self + { + $this->options['parameter76Value'] = $parameter76Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter77Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter77Name(string $parameter77Name): self + { + $this->options['parameter77Name'] = $parameter77Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter77Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter77Value(string $parameter77Value): self + { + $this->options['parameter77Value'] = $parameter77Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter78Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter78Name(string $parameter78Name): self + { + $this->options['parameter78Name'] = $parameter78Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter78Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter78Value(string $parameter78Value): self + { + $this->options['parameter78Value'] = $parameter78Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter79Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter79Name(string $parameter79Name): self + { + $this->options['parameter79Name'] = $parameter79Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter79Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter79Value(string $parameter79Value): self + { + $this->options['parameter79Value'] = $parameter79Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter80Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter80Name(string $parameter80Name): self + { + $this->options['parameter80Name'] = $parameter80Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter80Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter80Value(string $parameter80Value): self + { + $this->options['parameter80Value'] = $parameter80Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter81Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter81Name(string $parameter81Name): self + { + $this->options['parameter81Name'] = $parameter81Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter81Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter81Value(string $parameter81Value): self + { + $this->options['parameter81Value'] = $parameter81Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter82Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter82Name(string $parameter82Name): self + { + $this->options['parameter82Name'] = $parameter82Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter82Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter82Value(string $parameter82Value): self + { + $this->options['parameter82Value'] = $parameter82Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter83Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter83Name(string $parameter83Name): self + { + $this->options['parameter83Name'] = $parameter83Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter83Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter83Value(string $parameter83Value): self + { + $this->options['parameter83Value'] = $parameter83Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter84Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter84Name(string $parameter84Name): self + { + $this->options['parameter84Name'] = $parameter84Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter84Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter84Value(string $parameter84Value): self + { + $this->options['parameter84Value'] = $parameter84Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter85Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter85Name(string $parameter85Name): self + { + $this->options['parameter85Name'] = $parameter85Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter85Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter85Value(string $parameter85Value): self + { + $this->options['parameter85Value'] = $parameter85Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter86Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter86Name(string $parameter86Name): self + { + $this->options['parameter86Name'] = $parameter86Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter86Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter86Value(string $parameter86Value): self + { + $this->options['parameter86Value'] = $parameter86Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter87Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter87Name(string $parameter87Name): self + { + $this->options['parameter87Name'] = $parameter87Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter87Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter87Value(string $parameter87Value): self + { + $this->options['parameter87Value'] = $parameter87Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter88Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter88Name(string $parameter88Name): self + { + $this->options['parameter88Name'] = $parameter88Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter88Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter88Value(string $parameter88Value): self + { + $this->options['parameter88Value'] = $parameter88Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter89Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter89Name(string $parameter89Name): self + { + $this->options['parameter89Name'] = $parameter89Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter89Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter89Value(string $parameter89Value): self + { + $this->options['parameter89Value'] = $parameter89Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter90Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter90Name(string $parameter90Name): self + { + $this->options['parameter90Name'] = $parameter90Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter90Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter90Value(string $parameter90Value): self + { + $this->options['parameter90Value'] = $parameter90Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter91Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter91Name(string $parameter91Name): self + { + $this->options['parameter91Name'] = $parameter91Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter91Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter91Value(string $parameter91Value): self + { + $this->options['parameter91Value'] = $parameter91Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter92Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter92Name(string $parameter92Name): self + { + $this->options['parameter92Name'] = $parameter92Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter92Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter92Value(string $parameter92Value): self + { + $this->options['parameter92Value'] = $parameter92Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter93Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter93Name(string $parameter93Name): self + { + $this->options['parameter93Name'] = $parameter93Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter93Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter93Value(string $parameter93Value): self + { + $this->options['parameter93Value'] = $parameter93Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter94Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter94Name(string $parameter94Name): self + { + $this->options['parameter94Name'] = $parameter94Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter94Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter94Value(string $parameter94Value): self + { + $this->options['parameter94Value'] = $parameter94Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter95Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter95Name(string $parameter95Name): self + { + $this->options['parameter95Name'] = $parameter95Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter95Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter95Value(string $parameter95Value): self + { + $this->options['parameter95Value'] = $parameter95Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter96Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter96Name(string $parameter96Name): self + { + $this->options['parameter96Name'] = $parameter96Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter96Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter96Value(string $parameter96Value): self + { + $this->options['parameter96Value'] = $parameter96Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter97Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter97Name(string $parameter97Name): self + { + $this->options['parameter97Name'] = $parameter97Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter97Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter97Value(string $parameter97Value): self + { + $this->options['parameter97Value'] = $parameter97Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter98Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter98Name(string $parameter98Name): self + { + $this->options['parameter98Name'] = $parameter98Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter98Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter98Value(string $parameter98Value): self + { + $this->options['parameter98Value'] = $parameter98Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter99Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter99Name(string $parameter99Name): self + { + $this->options['parameter99Name'] = $parameter99Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter99Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter99Value(string $parameter99Value): self + { + $this->options['parameter99Value'] = $parameter99Value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateStreamOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php new file mode 100644 index 0000000..0ab00a1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StreamInstance \Twilio\Rest\Api\V2010\Account\Call\StreamInstance + */ + public function buildInstance(array $payload): StreamInstance + { + return new StreamInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.StreamPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionContext.php new file mode 100644 index 0000000..3a50707 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionContext.php @@ -0,0 +1,101 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Transcriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the TranscriptionInstance + * + * @param string $status + * @return TranscriptionInstance Updated TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): TranscriptionInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionInstance.php new file mode 100644 index 0000000..883d6a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'name' => Values::array_get($payload, 'name'), + 'status' => Values::array_get($payload, 'status'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 TranscriptionContext Context for this TranscriptionInstance + */ + protected function proxy(): TranscriptionContext + { + if (!$this->context) { + $this->context = new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the TranscriptionInstance + * + * @param string $status + * @return TranscriptionInstance Updated TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): TranscriptionInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionList.php new file mode 100644 index 0000000..58e9c98 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionList.php @@ -0,0 +1,534 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Transcriptions.json'; + } + + /** + * Create the TranscriptionInstance + * + * @param array|Options $options Optional Arguments + * @return TranscriptionInstance Created TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TranscriptionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $options['name'], + 'Track' => + $options['track'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'InboundTrackLabel' => + $options['inboundTrackLabel'], + 'OutboundTrackLabel' => + $options['outboundTrackLabel'], + 'PartialResults' => + Serialize::booleanToString($options['partialResults']), + 'LanguageCode' => + $options['languageCode'], + 'TranscriptionEngine' => + $options['transcriptionEngine'], + 'ProfanityFilter' => + Serialize::booleanToString($options['profanityFilter']), + 'SpeechModel' => + $options['speechModel'], + 'Hints' => + $options['hints'], + 'EnableAutomaticPunctuation' => + Serialize::booleanToString($options['enableAutomaticPunctuation']), + 'Parameter1.Name' => + $options['parameter1Name'], + 'Parameter1.Value' => + $options['parameter1Value'], + 'Parameter2.Name' => + $options['parameter2Name'], + 'Parameter2.Value' => + $options['parameter2Value'], + 'Parameter3.Name' => + $options['parameter3Name'], + 'Parameter3.Value' => + $options['parameter3Value'], + 'Parameter4.Name' => + $options['parameter4Name'], + 'Parameter4.Value' => + $options['parameter4Value'], + 'Parameter5.Name' => + $options['parameter5Name'], + 'Parameter5.Value' => + $options['parameter5Value'], + 'Parameter6.Name' => + $options['parameter6Name'], + 'Parameter6.Value' => + $options['parameter6Value'], + 'Parameter7.Name' => + $options['parameter7Name'], + 'Parameter7.Value' => + $options['parameter7Value'], + 'Parameter8.Name' => + $options['parameter8Name'], + 'Parameter8.Value' => + $options['parameter8Value'], + 'Parameter9.Name' => + $options['parameter9Name'], + 'Parameter9.Value' => + $options['parameter9Value'], + 'Parameter10.Name' => + $options['parameter10Name'], + 'Parameter10.Value' => + $options['parameter10Value'], + 'Parameter11.Name' => + $options['parameter11Name'], + 'Parameter11.Value' => + $options['parameter11Value'], + 'Parameter12.Name' => + $options['parameter12Name'], + 'Parameter12.Value' => + $options['parameter12Value'], + 'Parameter13.Name' => + $options['parameter13Name'], + 'Parameter13.Value' => + $options['parameter13Value'], + 'Parameter14.Name' => + $options['parameter14Name'], + 'Parameter14.Value' => + $options['parameter14Value'], + 'Parameter15.Name' => + $options['parameter15Name'], + 'Parameter15.Value' => + $options['parameter15Value'], + 'Parameter16.Name' => + $options['parameter16Name'], + 'Parameter16.Value' => + $options['parameter16Value'], + 'Parameter17.Name' => + $options['parameter17Name'], + 'Parameter17.Value' => + $options['parameter17Value'], + 'Parameter18.Name' => + $options['parameter18Name'], + 'Parameter18.Value' => + $options['parameter18Value'], + 'Parameter19.Name' => + $options['parameter19Name'], + 'Parameter19.Value' => + $options['parameter19Value'], + 'Parameter20.Name' => + $options['parameter20Name'], + 'Parameter20.Value' => + $options['parameter20Value'], + 'Parameter21.Name' => + $options['parameter21Name'], + 'Parameter21.Value' => + $options['parameter21Value'], + 'Parameter22.Name' => + $options['parameter22Name'], + 'Parameter22.Value' => + $options['parameter22Value'], + 'Parameter23.Name' => + $options['parameter23Name'], + 'Parameter23.Value' => + $options['parameter23Value'], + 'Parameter24.Name' => + $options['parameter24Name'], + 'Parameter24.Value' => + $options['parameter24Value'], + 'Parameter25.Name' => + $options['parameter25Name'], + 'Parameter25.Value' => + $options['parameter25Value'], + 'Parameter26.Name' => + $options['parameter26Name'], + 'Parameter26.Value' => + $options['parameter26Value'], + 'Parameter27.Name' => + $options['parameter27Name'], + 'Parameter27.Value' => + $options['parameter27Value'], + 'Parameter28.Name' => + $options['parameter28Name'], + 'Parameter28.Value' => + $options['parameter28Value'], + 'Parameter29.Name' => + $options['parameter29Name'], + 'Parameter29.Value' => + $options['parameter29Value'], + 'Parameter30.Name' => + $options['parameter30Name'], + 'Parameter30.Value' => + $options['parameter30Value'], + 'Parameter31.Name' => + $options['parameter31Name'], + 'Parameter31.Value' => + $options['parameter31Value'], + 'Parameter32.Name' => + $options['parameter32Name'], + 'Parameter32.Value' => + $options['parameter32Value'], + 'Parameter33.Name' => + $options['parameter33Name'], + 'Parameter33.Value' => + $options['parameter33Value'], + 'Parameter34.Name' => + $options['parameter34Name'], + 'Parameter34.Value' => + $options['parameter34Value'], + 'Parameter35.Name' => + $options['parameter35Name'], + 'Parameter35.Value' => + $options['parameter35Value'], + 'Parameter36.Name' => + $options['parameter36Name'], + 'Parameter36.Value' => + $options['parameter36Value'], + 'Parameter37.Name' => + $options['parameter37Name'], + 'Parameter37.Value' => + $options['parameter37Value'], + 'Parameter38.Name' => + $options['parameter38Name'], + 'Parameter38.Value' => + $options['parameter38Value'], + 'Parameter39.Name' => + $options['parameter39Name'], + 'Parameter39.Value' => + $options['parameter39Value'], + 'Parameter40.Name' => + $options['parameter40Name'], + 'Parameter40.Value' => + $options['parameter40Value'], + 'Parameter41.Name' => + $options['parameter41Name'], + 'Parameter41.Value' => + $options['parameter41Value'], + 'Parameter42.Name' => + $options['parameter42Name'], + 'Parameter42.Value' => + $options['parameter42Value'], + 'Parameter43.Name' => + $options['parameter43Name'], + 'Parameter43.Value' => + $options['parameter43Value'], + 'Parameter44.Name' => + $options['parameter44Name'], + 'Parameter44.Value' => + $options['parameter44Value'], + 'Parameter45.Name' => + $options['parameter45Name'], + 'Parameter45.Value' => + $options['parameter45Value'], + 'Parameter46.Name' => + $options['parameter46Name'], + 'Parameter46.Value' => + $options['parameter46Value'], + 'Parameter47.Name' => + $options['parameter47Name'], + 'Parameter47.Value' => + $options['parameter47Value'], + 'Parameter48.Name' => + $options['parameter48Name'], + 'Parameter48.Value' => + $options['parameter48Value'], + 'Parameter49.Name' => + $options['parameter49Name'], + 'Parameter49.Value' => + $options['parameter49Value'], + 'Parameter50.Name' => + $options['parameter50Name'], + 'Parameter50.Value' => + $options['parameter50Value'], + 'Parameter51.Name' => + $options['parameter51Name'], + 'Parameter51.Value' => + $options['parameter51Value'], + 'Parameter52.Name' => + $options['parameter52Name'], + 'Parameter52.Value' => + $options['parameter52Value'], + 'Parameter53.Name' => + $options['parameter53Name'], + 'Parameter53.Value' => + $options['parameter53Value'], + 'Parameter54.Name' => + $options['parameter54Name'], + 'Parameter54.Value' => + $options['parameter54Value'], + 'Parameter55.Name' => + $options['parameter55Name'], + 'Parameter55.Value' => + $options['parameter55Value'], + 'Parameter56.Name' => + $options['parameter56Name'], + 'Parameter56.Value' => + $options['parameter56Value'], + 'Parameter57.Name' => + $options['parameter57Name'], + 'Parameter57.Value' => + $options['parameter57Value'], + 'Parameter58.Name' => + $options['parameter58Name'], + 'Parameter58.Value' => + $options['parameter58Value'], + 'Parameter59.Name' => + $options['parameter59Name'], + 'Parameter59.Value' => + $options['parameter59Value'], + 'Parameter60.Name' => + $options['parameter60Name'], + 'Parameter60.Value' => + $options['parameter60Value'], + 'Parameter61.Name' => + $options['parameter61Name'], + 'Parameter61.Value' => + $options['parameter61Value'], + 'Parameter62.Name' => + $options['parameter62Name'], + 'Parameter62.Value' => + $options['parameter62Value'], + 'Parameter63.Name' => + $options['parameter63Name'], + 'Parameter63.Value' => + $options['parameter63Value'], + 'Parameter64.Name' => + $options['parameter64Name'], + 'Parameter64.Value' => + $options['parameter64Value'], + 'Parameter65.Name' => + $options['parameter65Name'], + 'Parameter65.Value' => + $options['parameter65Value'], + 'Parameter66.Name' => + $options['parameter66Name'], + 'Parameter66.Value' => + $options['parameter66Value'], + 'Parameter67.Name' => + $options['parameter67Name'], + 'Parameter67.Value' => + $options['parameter67Value'], + 'Parameter68.Name' => + $options['parameter68Name'], + 'Parameter68.Value' => + $options['parameter68Value'], + 'Parameter69.Name' => + $options['parameter69Name'], + 'Parameter69.Value' => + $options['parameter69Value'], + 'Parameter70.Name' => + $options['parameter70Name'], + 'Parameter70.Value' => + $options['parameter70Value'], + 'Parameter71.Name' => + $options['parameter71Name'], + 'Parameter71.Value' => + $options['parameter71Value'], + 'Parameter72.Name' => + $options['parameter72Name'], + 'Parameter72.Value' => + $options['parameter72Value'], + 'Parameter73.Name' => + $options['parameter73Name'], + 'Parameter73.Value' => + $options['parameter73Value'], + 'Parameter74.Name' => + $options['parameter74Name'], + 'Parameter74.Value' => + $options['parameter74Value'], + 'Parameter75.Name' => + $options['parameter75Name'], + 'Parameter75.Value' => + $options['parameter75Value'], + 'Parameter76.Name' => + $options['parameter76Name'], + 'Parameter76.Value' => + $options['parameter76Value'], + 'Parameter77.Name' => + $options['parameter77Name'], + 'Parameter77.Value' => + $options['parameter77Value'], + 'Parameter78.Name' => + $options['parameter78Name'], + 'Parameter78.Value' => + $options['parameter78Value'], + 'Parameter79.Name' => + $options['parameter79Name'], + 'Parameter79.Value' => + $options['parameter79Value'], + 'Parameter80.Name' => + $options['parameter80Name'], + 'Parameter80.Value' => + $options['parameter80Value'], + 'Parameter81.Name' => + $options['parameter81Name'], + 'Parameter81.Value' => + $options['parameter81Value'], + 'Parameter82.Name' => + $options['parameter82Name'], + 'Parameter82.Value' => + $options['parameter82Value'], + 'Parameter83.Name' => + $options['parameter83Name'], + 'Parameter83.Value' => + $options['parameter83Value'], + 'Parameter84.Name' => + $options['parameter84Name'], + 'Parameter84.Value' => + $options['parameter84Value'], + 'Parameter85.Name' => + $options['parameter85Name'], + 'Parameter85.Value' => + $options['parameter85Value'], + 'Parameter86.Name' => + $options['parameter86Name'], + 'Parameter86.Value' => + $options['parameter86Value'], + 'Parameter87.Name' => + $options['parameter87Name'], + 'Parameter87.Value' => + $options['parameter87Value'], + 'Parameter88.Name' => + $options['parameter88Name'], + 'Parameter88.Value' => + $options['parameter88Value'], + 'Parameter89.Name' => + $options['parameter89Name'], + 'Parameter89.Value' => + $options['parameter89Value'], + 'Parameter90.Name' => + $options['parameter90Name'], + 'Parameter90.Value' => + $options['parameter90Value'], + 'Parameter91.Name' => + $options['parameter91Name'], + 'Parameter91.Value' => + $options['parameter91Value'], + 'Parameter92.Name' => + $options['parameter92Name'], + 'Parameter92.Value' => + $options['parameter92Value'], + 'Parameter93.Name' => + $options['parameter93Name'], + 'Parameter93.Value' => + $options['parameter93Value'], + 'Parameter94.Name' => + $options['parameter94Name'], + 'Parameter94.Value' => + $options['parameter94Value'], + 'Parameter95.Name' => + $options['parameter95Name'], + 'Parameter95.Value' => + $options['parameter95Value'], + 'Parameter96.Name' => + $options['parameter96Name'], + 'Parameter96.Value' => + $options['parameter96Value'], + 'Parameter97.Name' => + $options['parameter97Name'], + 'Parameter97.Value' => + $options['parameter97Value'], + 'Parameter98.Name' => + $options['parameter98Name'], + 'Parameter98.Value' => + $options['parameter98Value'], + 'Parameter99.Name' => + $options['parameter99Name'], + 'Parameter99.Value' => + $options['parameter99Value'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a TranscriptionContext + * + * @param string $sid The SID of the Transcription resource, or the `name` used when creating the resource + */ + public function getContext( + string $sid + + ): TranscriptionContext + { + return new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php new file mode 100644 index 0000000..80b9a1b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionOptions.php @@ -0,0 +1,3856 @@ +options['name'] = $name; + $this->options['track'] = $track; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['inboundTrackLabel'] = $inboundTrackLabel; + $this->options['outboundTrackLabel'] = $outboundTrackLabel; + $this->options['partialResults'] = $partialResults; + $this->options['languageCode'] = $languageCode; + $this->options['transcriptionEngine'] = $transcriptionEngine; + $this->options['profanityFilter'] = $profanityFilter; + $this->options['speechModel'] = $speechModel; + $this->options['hints'] = $hints; + $this->options['enableAutomaticPunctuation'] = $enableAutomaticPunctuation; + $this->options['parameter1Name'] = $parameter1Name; + $this->options['parameter1Value'] = $parameter1Value; + $this->options['parameter2Name'] = $parameter2Name; + $this->options['parameter2Value'] = $parameter2Value; + $this->options['parameter3Name'] = $parameter3Name; + $this->options['parameter3Value'] = $parameter3Value; + $this->options['parameter4Name'] = $parameter4Name; + $this->options['parameter4Value'] = $parameter4Value; + $this->options['parameter5Name'] = $parameter5Name; + $this->options['parameter5Value'] = $parameter5Value; + $this->options['parameter6Name'] = $parameter6Name; + $this->options['parameter6Value'] = $parameter6Value; + $this->options['parameter7Name'] = $parameter7Name; + $this->options['parameter7Value'] = $parameter7Value; + $this->options['parameter8Name'] = $parameter8Name; + $this->options['parameter8Value'] = $parameter8Value; + $this->options['parameter9Name'] = $parameter9Name; + $this->options['parameter9Value'] = $parameter9Value; + $this->options['parameter10Name'] = $parameter10Name; + $this->options['parameter10Value'] = $parameter10Value; + $this->options['parameter11Name'] = $parameter11Name; + $this->options['parameter11Value'] = $parameter11Value; + $this->options['parameter12Name'] = $parameter12Name; + $this->options['parameter12Value'] = $parameter12Value; + $this->options['parameter13Name'] = $parameter13Name; + $this->options['parameter13Value'] = $parameter13Value; + $this->options['parameter14Name'] = $parameter14Name; + $this->options['parameter14Value'] = $parameter14Value; + $this->options['parameter15Name'] = $parameter15Name; + $this->options['parameter15Value'] = $parameter15Value; + $this->options['parameter16Name'] = $parameter16Name; + $this->options['parameter16Value'] = $parameter16Value; + $this->options['parameter17Name'] = $parameter17Name; + $this->options['parameter17Value'] = $parameter17Value; + $this->options['parameter18Name'] = $parameter18Name; + $this->options['parameter18Value'] = $parameter18Value; + $this->options['parameter19Name'] = $parameter19Name; + $this->options['parameter19Value'] = $parameter19Value; + $this->options['parameter20Name'] = $parameter20Name; + $this->options['parameter20Value'] = $parameter20Value; + $this->options['parameter21Name'] = $parameter21Name; + $this->options['parameter21Value'] = $parameter21Value; + $this->options['parameter22Name'] = $parameter22Name; + $this->options['parameter22Value'] = $parameter22Value; + $this->options['parameter23Name'] = $parameter23Name; + $this->options['parameter23Value'] = $parameter23Value; + $this->options['parameter24Name'] = $parameter24Name; + $this->options['parameter24Value'] = $parameter24Value; + $this->options['parameter25Name'] = $parameter25Name; + $this->options['parameter25Value'] = $parameter25Value; + $this->options['parameter26Name'] = $parameter26Name; + $this->options['parameter26Value'] = $parameter26Value; + $this->options['parameter27Name'] = $parameter27Name; + $this->options['parameter27Value'] = $parameter27Value; + $this->options['parameter28Name'] = $parameter28Name; + $this->options['parameter28Value'] = $parameter28Value; + $this->options['parameter29Name'] = $parameter29Name; + $this->options['parameter29Value'] = $parameter29Value; + $this->options['parameter30Name'] = $parameter30Name; + $this->options['parameter30Value'] = $parameter30Value; + $this->options['parameter31Name'] = $parameter31Name; + $this->options['parameter31Value'] = $parameter31Value; + $this->options['parameter32Name'] = $parameter32Name; + $this->options['parameter32Value'] = $parameter32Value; + $this->options['parameter33Name'] = $parameter33Name; + $this->options['parameter33Value'] = $parameter33Value; + $this->options['parameter34Name'] = $parameter34Name; + $this->options['parameter34Value'] = $parameter34Value; + $this->options['parameter35Name'] = $parameter35Name; + $this->options['parameter35Value'] = $parameter35Value; + $this->options['parameter36Name'] = $parameter36Name; + $this->options['parameter36Value'] = $parameter36Value; + $this->options['parameter37Name'] = $parameter37Name; + $this->options['parameter37Value'] = $parameter37Value; + $this->options['parameter38Name'] = $parameter38Name; + $this->options['parameter38Value'] = $parameter38Value; + $this->options['parameter39Name'] = $parameter39Name; + $this->options['parameter39Value'] = $parameter39Value; + $this->options['parameter40Name'] = $parameter40Name; + $this->options['parameter40Value'] = $parameter40Value; + $this->options['parameter41Name'] = $parameter41Name; + $this->options['parameter41Value'] = $parameter41Value; + $this->options['parameter42Name'] = $parameter42Name; + $this->options['parameter42Value'] = $parameter42Value; + $this->options['parameter43Name'] = $parameter43Name; + $this->options['parameter43Value'] = $parameter43Value; + $this->options['parameter44Name'] = $parameter44Name; + $this->options['parameter44Value'] = $parameter44Value; + $this->options['parameter45Name'] = $parameter45Name; + $this->options['parameter45Value'] = $parameter45Value; + $this->options['parameter46Name'] = $parameter46Name; + $this->options['parameter46Value'] = $parameter46Value; + $this->options['parameter47Name'] = $parameter47Name; + $this->options['parameter47Value'] = $parameter47Value; + $this->options['parameter48Name'] = $parameter48Name; + $this->options['parameter48Value'] = $parameter48Value; + $this->options['parameter49Name'] = $parameter49Name; + $this->options['parameter49Value'] = $parameter49Value; + $this->options['parameter50Name'] = $parameter50Name; + $this->options['parameter50Value'] = $parameter50Value; + $this->options['parameter51Name'] = $parameter51Name; + $this->options['parameter51Value'] = $parameter51Value; + $this->options['parameter52Name'] = $parameter52Name; + $this->options['parameter52Value'] = $parameter52Value; + $this->options['parameter53Name'] = $parameter53Name; + $this->options['parameter53Value'] = $parameter53Value; + $this->options['parameter54Name'] = $parameter54Name; + $this->options['parameter54Value'] = $parameter54Value; + $this->options['parameter55Name'] = $parameter55Name; + $this->options['parameter55Value'] = $parameter55Value; + $this->options['parameter56Name'] = $parameter56Name; + $this->options['parameter56Value'] = $parameter56Value; + $this->options['parameter57Name'] = $parameter57Name; + $this->options['parameter57Value'] = $parameter57Value; + $this->options['parameter58Name'] = $parameter58Name; + $this->options['parameter58Value'] = $parameter58Value; + $this->options['parameter59Name'] = $parameter59Name; + $this->options['parameter59Value'] = $parameter59Value; + $this->options['parameter60Name'] = $parameter60Name; + $this->options['parameter60Value'] = $parameter60Value; + $this->options['parameter61Name'] = $parameter61Name; + $this->options['parameter61Value'] = $parameter61Value; + $this->options['parameter62Name'] = $parameter62Name; + $this->options['parameter62Value'] = $parameter62Value; + $this->options['parameter63Name'] = $parameter63Name; + $this->options['parameter63Value'] = $parameter63Value; + $this->options['parameter64Name'] = $parameter64Name; + $this->options['parameter64Value'] = $parameter64Value; + $this->options['parameter65Name'] = $parameter65Name; + $this->options['parameter65Value'] = $parameter65Value; + $this->options['parameter66Name'] = $parameter66Name; + $this->options['parameter66Value'] = $parameter66Value; + $this->options['parameter67Name'] = $parameter67Name; + $this->options['parameter67Value'] = $parameter67Value; + $this->options['parameter68Name'] = $parameter68Name; + $this->options['parameter68Value'] = $parameter68Value; + $this->options['parameter69Name'] = $parameter69Name; + $this->options['parameter69Value'] = $parameter69Value; + $this->options['parameter70Name'] = $parameter70Name; + $this->options['parameter70Value'] = $parameter70Value; + $this->options['parameter71Name'] = $parameter71Name; + $this->options['parameter71Value'] = $parameter71Value; + $this->options['parameter72Name'] = $parameter72Name; + $this->options['parameter72Value'] = $parameter72Value; + $this->options['parameter73Name'] = $parameter73Name; + $this->options['parameter73Value'] = $parameter73Value; + $this->options['parameter74Name'] = $parameter74Name; + $this->options['parameter74Value'] = $parameter74Value; + $this->options['parameter75Name'] = $parameter75Name; + $this->options['parameter75Value'] = $parameter75Value; + $this->options['parameter76Name'] = $parameter76Name; + $this->options['parameter76Value'] = $parameter76Value; + $this->options['parameter77Name'] = $parameter77Name; + $this->options['parameter77Value'] = $parameter77Value; + $this->options['parameter78Name'] = $parameter78Name; + $this->options['parameter78Value'] = $parameter78Value; + $this->options['parameter79Name'] = $parameter79Name; + $this->options['parameter79Value'] = $parameter79Value; + $this->options['parameter80Name'] = $parameter80Name; + $this->options['parameter80Value'] = $parameter80Value; + $this->options['parameter81Name'] = $parameter81Name; + $this->options['parameter81Value'] = $parameter81Value; + $this->options['parameter82Name'] = $parameter82Name; + $this->options['parameter82Value'] = $parameter82Value; + $this->options['parameter83Name'] = $parameter83Name; + $this->options['parameter83Value'] = $parameter83Value; + $this->options['parameter84Name'] = $parameter84Name; + $this->options['parameter84Value'] = $parameter84Value; + $this->options['parameter85Name'] = $parameter85Name; + $this->options['parameter85Value'] = $parameter85Value; + $this->options['parameter86Name'] = $parameter86Name; + $this->options['parameter86Value'] = $parameter86Value; + $this->options['parameter87Name'] = $parameter87Name; + $this->options['parameter87Value'] = $parameter87Value; + $this->options['parameter88Name'] = $parameter88Name; + $this->options['parameter88Value'] = $parameter88Value; + $this->options['parameter89Name'] = $parameter89Name; + $this->options['parameter89Value'] = $parameter89Value; + $this->options['parameter90Name'] = $parameter90Name; + $this->options['parameter90Value'] = $parameter90Value; + $this->options['parameter91Name'] = $parameter91Name; + $this->options['parameter91Value'] = $parameter91Value; + $this->options['parameter92Name'] = $parameter92Name; + $this->options['parameter92Value'] = $parameter92Value; + $this->options['parameter93Name'] = $parameter93Name; + $this->options['parameter93Value'] = $parameter93Value; + $this->options['parameter94Name'] = $parameter94Name; + $this->options['parameter94Value'] = $parameter94Value; + $this->options['parameter95Name'] = $parameter95Name; + $this->options['parameter95Value'] = $parameter95Value; + $this->options['parameter96Name'] = $parameter96Name; + $this->options['parameter96Value'] = $parameter96Value; + $this->options['parameter97Name'] = $parameter97Name; + $this->options['parameter97Value'] = $parameter97Value; + $this->options['parameter98Name'] = $parameter98Name; + $this->options['parameter98Value'] = $parameter98Value; + $this->options['parameter99Name'] = $parameter99Name; + $this->options['parameter99Value'] = $parameter99Value; + } + + /** + * The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + * + * @param string $name The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * @param string $track + * @return $this Fluent Builder + */ + public function setTrack(string $track): self + { + $this->options['track'] = $track; + return $this; + } + + /** + * Absolute URL of the status callback. + * + * @param string $statusCallbackUrl Absolute URL of the status callback. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * The http method for the status_callback (one of GET, POST). + * + * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Friendly name given to the Inbound Track + * + * @param string $inboundTrackLabel Friendly name given to the Inbound Track + * @return $this Fluent Builder + */ + public function setInboundTrackLabel(string $inboundTrackLabel): self + { + $this->options['inboundTrackLabel'] = $inboundTrackLabel; + return $this; + } + + /** + * Friendly name given to the Outbound Track + * + * @param string $outboundTrackLabel Friendly name given to the Outbound Track + * @return $this Fluent Builder + */ + public function setOutboundTrackLabel(string $outboundTrackLabel): self + { + $this->options['outboundTrackLabel'] = $outboundTrackLabel; + return $this; + } + + /** + * Indicates if partial results are going to be send to the customer + * + * @param bool $partialResults Indicates if partial results are going to be send to the customer + * @return $this Fluent Builder + */ + public function setPartialResults(bool $partialResults): self + { + $this->options['partialResults'] = $partialResults; + return $this; + } + + /** + * Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + * + * @param string $languageCode Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Definition of the transcription engine to be used, between those supported by Twilio + * + * @param string $transcriptionEngine Definition of the transcription engine to be used, between those supported by Twilio + * @return $this Fluent Builder + */ + public function setTranscriptionEngine(string $transcriptionEngine): self + { + $this->options['transcriptionEngine'] = $transcriptionEngine; + return $this; + } + + /** + * indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + * + * @param bool $profanityFilter indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + * @return $this Fluent Builder + */ + public function setProfanityFilter(bool $profanityFilter): self + { + $this->options['profanityFilter'] = $profanityFilter; + return $this; + } + + /** + * Recognition model used by the transcription engine, between those supported by the provider + * + * @param string $speechModel Recognition model used by the transcription engine, between those supported by the provider + * @return $this Fluent Builder + */ + public function setSpeechModel(string $speechModel): self + { + $this->options['speechModel'] = $speechModel; + return $this; + } + + /** + * A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + * + * @param string $hints A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + * @return $this Fluent Builder + */ + public function setHints(string $hints): self + { + $this->options['hints'] = $hints; + return $this; + } + + /** + * The provider will adds punctuation to recognition result hypotheses + * + * @param bool $enableAutomaticPunctuation The provider will adds punctuation to recognition result hypotheses + * @return $this Fluent Builder + */ + public function setEnableAutomaticPunctuation(bool $enableAutomaticPunctuation): self + { + $this->options['enableAutomaticPunctuation'] = $enableAutomaticPunctuation; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter1Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter1Name(string $parameter1Name): self + { + $this->options['parameter1Name'] = $parameter1Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter1Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter1Value(string $parameter1Value): self + { + $this->options['parameter1Value'] = $parameter1Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter2Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter2Name(string $parameter2Name): self + { + $this->options['parameter2Name'] = $parameter2Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter2Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter2Value(string $parameter2Value): self + { + $this->options['parameter2Value'] = $parameter2Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter3Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter3Name(string $parameter3Name): self + { + $this->options['parameter3Name'] = $parameter3Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter3Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter3Value(string $parameter3Value): self + { + $this->options['parameter3Value'] = $parameter3Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter4Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter4Name(string $parameter4Name): self + { + $this->options['parameter4Name'] = $parameter4Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter4Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter4Value(string $parameter4Value): self + { + $this->options['parameter4Value'] = $parameter4Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter5Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter5Name(string $parameter5Name): self + { + $this->options['parameter5Name'] = $parameter5Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter5Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter5Value(string $parameter5Value): self + { + $this->options['parameter5Value'] = $parameter5Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter6Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter6Name(string $parameter6Name): self + { + $this->options['parameter6Name'] = $parameter6Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter6Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter6Value(string $parameter6Value): self + { + $this->options['parameter6Value'] = $parameter6Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter7Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter7Name(string $parameter7Name): self + { + $this->options['parameter7Name'] = $parameter7Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter7Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter7Value(string $parameter7Value): self + { + $this->options['parameter7Value'] = $parameter7Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter8Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter8Name(string $parameter8Name): self + { + $this->options['parameter8Name'] = $parameter8Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter8Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter8Value(string $parameter8Value): self + { + $this->options['parameter8Value'] = $parameter8Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter9Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter9Name(string $parameter9Name): self + { + $this->options['parameter9Name'] = $parameter9Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter9Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter9Value(string $parameter9Value): self + { + $this->options['parameter9Value'] = $parameter9Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter10Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter10Name(string $parameter10Name): self + { + $this->options['parameter10Name'] = $parameter10Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter10Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter10Value(string $parameter10Value): self + { + $this->options['parameter10Value'] = $parameter10Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter11Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter11Name(string $parameter11Name): self + { + $this->options['parameter11Name'] = $parameter11Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter11Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter11Value(string $parameter11Value): self + { + $this->options['parameter11Value'] = $parameter11Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter12Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter12Name(string $parameter12Name): self + { + $this->options['parameter12Name'] = $parameter12Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter12Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter12Value(string $parameter12Value): self + { + $this->options['parameter12Value'] = $parameter12Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter13Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter13Name(string $parameter13Name): self + { + $this->options['parameter13Name'] = $parameter13Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter13Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter13Value(string $parameter13Value): self + { + $this->options['parameter13Value'] = $parameter13Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter14Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter14Name(string $parameter14Name): self + { + $this->options['parameter14Name'] = $parameter14Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter14Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter14Value(string $parameter14Value): self + { + $this->options['parameter14Value'] = $parameter14Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter15Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter15Name(string $parameter15Name): self + { + $this->options['parameter15Name'] = $parameter15Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter15Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter15Value(string $parameter15Value): self + { + $this->options['parameter15Value'] = $parameter15Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter16Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter16Name(string $parameter16Name): self + { + $this->options['parameter16Name'] = $parameter16Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter16Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter16Value(string $parameter16Value): self + { + $this->options['parameter16Value'] = $parameter16Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter17Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter17Name(string $parameter17Name): self + { + $this->options['parameter17Name'] = $parameter17Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter17Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter17Value(string $parameter17Value): self + { + $this->options['parameter17Value'] = $parameter17Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter18Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter18Name(string $parameter18Name): self + { + $this->options['parameter18Name'] = $parameter18Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter18Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter18Value(string $parameter18Value): self + { + $this->options['parameter18Value'] = $parameter18Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter19Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter19Name(string $parameter19Name): self + { + $this->options['parameter19Name'] = $parameter19Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter19Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter19Value(string $parameter19Value): self + { + $this->options['parameter19Value'] = $parameter19Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter20Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter20Name(string $parameter20Name): self + { + $this->options['parameter20Name'] = $parameter20Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter20Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter20Value(string $parameter20Value): self + { + $this->options['parameter20Value'] = $parameter20Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter21Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter21Name(string $parameter21Name): self + { + $this->options['parameter21Name'] = $parameter21Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter21Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter21Value(string $parameter21Value): self + { + $this->options['parameter21Value'] = $parameter21Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter22Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter22Name(string $parameter22Name): self + { + $this->options['parameter22Name'] = $parameter22Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter22Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter22Value(string $parameter22Value): self + { + $this->options['parameter22Value'] = $parameter22Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter23Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter23Name(string $parameter23Name): self + { + $this->options['parameter23Name'] = $parameter23Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter23Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter23Value(string $parameter23Value): self + { + $this->options['parameter23Value'] = $parameter23Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter24Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter24Name(string $parameter24Name): self + { + $this->options['parameter24Name'] = $parameter24Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter24Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter24Value(string $parameter24Value): self + { + $this->options['parameter24Value'] = $parameter24Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter25Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter25Name(string $parameter25Name): self + { + $this->options['parameter25Name'] = $parameter25Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter25Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter25Value(string $parameter25Value): self + { + $this->options['parameter25Value'] = $parameter25Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter26Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter26Name(string $parameter26Name): self + { + $this->options['parameter26Name'] = $parameter26Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter26Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter26Value(string $parameter26Value): self + { + $this->options['parameter26Value'] = $parameter26Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter27Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter27Name(string $parameter27Name): self + { + $this->options['parameter27Name'] = $parameter27Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter27Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter27Value(string $parameter27Value): self + { + $this->options['parameter27Value'] = $parameter27Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter28Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter28Name(string $parameter28Name): self + { + $this->options['parameter28Name'] = $parameter28Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter28Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter28Value(string $parameter28Value): self + { + $this->options['parameter28Value'] = $parameter28Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter29Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter29Name(string $parameter29Name): self + { + $this->options['parameter29Name'] = $parameter29Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter29Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter29Value(string $parameter29Value): self + { + $this->options['parameter29Value'] = $parameter29Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter30Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter30Name(string $parameter30Name): self + { + $this->options['parameter30Name'] = $parameter30Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter30Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter30Value(string $parameter30Value): self + { + $this->options['parameter30Value'] = $parameter30Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter31Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter31Name(string $parameter31Name): self + { + $this->options['parameter31Name'] = $parameter31Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter31Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter31Value(string $parameter31Value): self + { + $this->options['parameter31Value'] = $parameter31Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter32Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter32Name(string $parameter32Name): self + { + $this->options['parameter32Name'] = $parameter32Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter32Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter32Value(string $parameter32Value): self + { + $this->options['parameter32Value'] = $parameter32Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter33Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter33Name(string $parameter33Name): self + { + $this->options['parameter33Name'] = $parameter33Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter33Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter33Value(string $parameter33Value): self + { + $this->options['parameter33Value'] = $parameter33Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter34Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter34Name(string $parameter34Name): self + { + $this->options['parameter34Name'] = $parameter34Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter34Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter34Value(string $parameter34Value): self + { + $this->options['parameter34Value'] = $parameter34Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter35Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter35Name(string $parameter35Name): self + { + $this->options['parameter35Name'] = $parameter35Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter35Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter35Value(string $parameter35Value): self + { + $this->options['parameter35Value'] = $parameter35Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter36Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter36Name(string $parameter36Name): self + { + $this->options['parameter36Name'] = $parameter36Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter36Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter36Value(string $parameter36Value): self + { + $this->options['parameter36Value'] = $parameter36Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter37Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter37Name(string $parameter37Name): self + { + $this->options['parameter37Name'] = $parameter37Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter37Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter37Value(string $parameter37Value): self + { + $this->options['parameter37Value'] = $parameter37Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter38Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter38Name(string $parameter38Name): self + { + $this->options['parameter38Name'] = $parameter38Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter38Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter38Value(string $parameter38Value): self + { + $this->options['parameter38Value'] = $parameter38Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter39Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter39Name(string $parameter39Name): self + { + $this->options['parameter39Name'] = $parameter39Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter39Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter39Value(string $parameter39Value): self + { + $this->options['parameter39Value'] = $parameter39Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter40Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter40Name(string $parameter40Name): self + { + $this->options['parameter40Name'] = $parameter40Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter40Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter40Value(string $parameter40Value): self + { + $this->options['parameter40Value'] = $parameter40Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter41Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter41Name(string $parameter41Name): self + { + $this->options['parameter41Name'] = $parameter41Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter41Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter41Value(string $parameter41Value): self + { + $this->options['parameter41Value'] = $parameter41Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter42Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter42Name(string $parameter42Name): self + { + $this->options['parameter42Name'] = $parameter42Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter42Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter42Value(string $parameter42Value): self + { + $this->options['parameter42Value'] = $parameter42Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter43Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter43Name(string $parameter43Name): self + { + $this->options['parameter43Name'] = $parameter43Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter43Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter43Value(string $parameter43Value): self + { + $this->options['parameter43Value'] = $parameter43Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter44Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter44Name(string $parameter44Name): self + { + $this->options['parameter44Name'] = $parameter44Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter44Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter44Value(string $parameter44Value): self + { + $this->options['parameter44Value'] = $parameter44Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter45Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter45Name(string $parameter45Name): self + { + $this->options['parameter45Name'] = $parameter45Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter45Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter45Value(string $parameter45Value): self + { + $this->options['parameter45Value'] = $parameter45Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter46Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter46Name(string $parameter46Name): self + { + $this->options['parameter46Name'] = $parameter46Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter46Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter46Value(string $parameter46Value): self + { + $this->options['parameter46Value'] = $parameter46Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter47Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter47Name(string $parameter47Name): self + { + $this->options['parameter47Name'] = $parameter47Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter47Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter47Value(string $parameter47Value): self + { + $this->options['parameter47Value'] = $parameter47Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter48Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter48Name(string $parameter48Name): self + { + $this->options['parameter48Name'] = $parameter48Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter48Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter48Value(string $parameter48Value): self + { + $this->options['parameter48Value'] = $parameter48Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter49Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter49Name(string $parameter49Name): self + { + $this->options['parameter49Name'] = $parameter49Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter49Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter49Value(string $parameter49Value): self + { + $this->options['parameter49Value'] = $parameter49Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter50Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter50Name(string $parameter50Name): self + { + $this->options['parameter50Name'] = $parameter50Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter50Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter50Value(string $parameter50Value): self + { + $this->options['parameter50Value'] = $parameter50Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter51Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter51Name(string $parameter51Name): self + { + $this->options['parameter51Name'] = $parameter51Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter51Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter51Value(string $parameter51Value): self + { + $this->options['parameter51Value'] = $parameter51Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter52Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter52Name(string $parameter52Name): self + { + $this->options['parameter52Name'] = $parameter52Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter52Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter52Value(string $parameter52Value): self + { + $this->options['parameter52Value'] = $parameter52Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter53Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter53Name(string $parameter53Name): self + { + $this->options['parameter53Name'] = $parameter53Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter53Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter53Value(string $parameter53Value): self + { + $this->options['parameter53Value'] = $parameter53Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter54Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter54Name(string $parameter54Name): self + { + $this->options['parameter54Name'] = $parameter54Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter54Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter54Value(string $parameter54Value): self + { + $this->options['parameter54Value'] = $parameter54Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter55Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter55Name(string $parameter55Name): self + { + $this->options['parameter55Name'] = $parameter55Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter55Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter55Value(string $parameter55Value): self + { + $this->options['parameter55Value'] = $parameter55Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter56Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter56Name(string $parameter56Name): self + { + $this->options['parameter56Name'] = $parameter56Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter56Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter56Value(string $parameter56Value): self + { + $this->options['parameter56Value'] = $parameter56Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter57Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter57Name(string $parameter57Name): self + { + $this->options['parameter57Name'] = $parameter57Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter57Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter57Value(string $parameter57Value): self + { + $this->options['parameter57Value'] = $parameter57Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter58Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter58Name(string $parameter58Name): self + { + $this->options['parameter58Name'] = $parameter58Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter58Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter58Value(string $parameter58Value): self + { + $this->options['parameter58Value'] = $parameter58Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter59Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter59Name(string $parameter59Name): self + { + $this->options['parameter59Name'] = $parameter59Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter59Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter59Value(string $parameter59Value): self + { + $this->options['parameter59Value'] = $parameter59Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter60Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter60Name(string $parameter60Name): self + { + $this->options['parameter60Name'] = $parameter60Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter60Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter60Value(string $parameter60Value): self + { + $this->options['parameter60Value'] = $parameter60Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter61Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter61Name(string $parameter61Name): self + { + $this->options['parameter61Name'] = $parameter61Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter61Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter61Value(string $parameter61Value): self + { + $this->options['parameter61Value'] = $parameter61Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter62Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter62Name(string $parameter62Name): self + { + $this->options['parameter62Name'] = $parameter62Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter62Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter62Value(string $parameter62Value): self + { + $this->options['parameter62Value'] = $parameter62Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter63Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter63Name(string $parameter63Name): self + { + $this->options['parameter63Name'] = $parameter63Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter63Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter63Value(string $parameter63Value): self + { + $this->options['parameter63Value'] = $parameter63Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter64Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter64Name(string $parameter64Name): self + { + $this->options['parameter64Name'] = $parameter64Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter64Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter64Value(string $parameter64Value): self + { + $this->options['parameter64Value'] = $parameter64Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter65Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter65Name(string $parameter65Name): self + { + $this->options['parameter65Name'] = $parameter65Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter65Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter65Value(string $parameter65Value): self + { + $this->options['parameter65Value'] = $parameter65Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter66Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter66Name(string $parameter66Name): self + { + $this->options['parameter66Name'] = $parameter66Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter66Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter66Value(string $parameter66Value): self + { + $this->options['parameter66Value'] = $parameter66Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter67Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter67Name(string $parameter67Name): self + { + $this->options['parameter67Name'] = $parameter67Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter67Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter67Value(string $parameter67Value): self + { + $this->options['parameter67Value'] = $parameter67Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter68Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter68Name(string $parameter68Name): self + { + $this->options['parameter68Name'] = $parameter68Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter68Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter68Value(string $parameter68Value): self + { + $this->options['parameter68Value'] = $parameter68Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter69Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter69Name(string $parameter69Name): self + { + $this->options['parameter69Name'] = $parameter69Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter69Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter69Value(string $parameter69Value): self + { + $this->options['parameter69Value'] = $parameter69Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter70Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter70Name(string $parameter70Name): self + { + $this->options['parameter70Name'] = $parameter70Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter70Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter70Value(string $parameter70Value): self + { + $this->options['parameter70Value'] = $parameter70Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter71Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter71Name(string $parameter71Name): self + { + $this->options['parameter71Name'] = $parameter71Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter71Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter71Value(string $parameter71Value): self + { + $this->options['parameter71Value'] = $parameter71Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter72Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter72Name(string $parameter72Name): self + { + $this->options['parameter72Name'] = $parameter72Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter72Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter72Value(string $parameter72Value): self + { + $this->options['parameter72Value'] = $parameter72Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter73Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter73Name(string $parameter73Name): self + { + $this->options['parameter73Name'] = $parameter73Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter73Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter73Value(string $parameter73Value): self + { + $this->options['parameter73Value'] = $parameter73Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter74Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter74Name(string $parameter74Name): self + { + $this->options['parameter74Name'] = $parameter74Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter74Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter74Value(string $parameter74Value): self + { + $this->options['parameter74Value'] = $parameter74Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter75Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter75Name(string $parameter75Name): self + { + $this->options['parameter75Name'] = $parameter75Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter75Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter75Value(string $parameter75Value): self + { + $this->options['parameter75Value'] = $parameter75Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter76Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter76Name(string $parameter76Name): self + { + $this->options['parameter76Name'] = $parameter76Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter76Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter76Value(string $parameter76Value): self + { + $this->options['parameter76Value'] = $parameter76Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter77Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter77Name(string $parameter77Name): self + { + $this->options['parameter77Name'] = $parameter77Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter77Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter77Value(string $parameter77Value): self + { + $this->options['parameter77Value'] = $parameter77Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter78Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter78Name(string $parameter78Name): self + { + $this->options['parameter78Name'] = $parameter78Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter78Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter78Value(string $parameter78Value): self + { + $this->options['parameter78Value'] = $parameter78Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter79Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter79Name(string $parameter79Name): self + { + $this->options['parameter79Name'] = $parameter79Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter79Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter79Value(string $parameter79Value): self + { + $this->options['parameter79Value'] = $parameter79Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter80Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter80Name(string $parameter80Name): self + { + $this->options['parameter80Name'] = $parameter80Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter80Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter80Value(string $parameter80Value): self + { + $this->options['parameter80Value'] = $parameter80Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter81Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter81Name(string $parameter81Name): self + { + $this->options['parameter81Name'] = $parameter81Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter81Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter81Value(string $parameter81Value): self + { + $this->options['parameter81Value'] = $parameter81Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter82Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter82Name(string $parameter82Name): self + { + $this->options['parameter82Name'] = $parameter82Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter82Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter82Value(string $parameter82Value): self + { + $this->options['parameter82Value'] = $parameter82Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter83Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter83Name(string $parameter83Name): self + { + $this->options['parameter83Name'] = $parameter83Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter83Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter83Value(string $parameter83Value): self + { + $this->options['parameter83Value'] = $parameter83Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter84Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter84Name(string $parameter84Name): self + { + $this->options['parameter84Name'] = $parameter84Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter84Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter84Value(string $parameter84Value): self + { + $this->options['parameter84Value'] = $parameter84Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter85Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter85Name(string $parameter85Name): self + { + $this->options['parameter85Name'] = $parameter85Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter85Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter85Value(string $parameter85Value): self + { + $this->options['parameter85Value'] = $parameter85Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter86Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter86Name(string $parameter86Name): self + { + $this->options['parameter86Name'] = $parameter86Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter86Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter86Value(string $parameter86Value): self + { + $this->options['parameter86Value'] = $parameter86Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter87Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter87Name(string $parameter87Name): self + { + $this->options['parameter87Name'] = $parameter87Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter87Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter87Value(string $parameter87Value): self + { + $this->options['parameter87Value'] = $parameter87Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter88Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter88Name(string $parameter88Name): self + { + $this->options['parameter88Name'] = $parameter88Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter88Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter88Value(string $parameter88Value): self + { + $this->options['parameter88Value'] = $parameter88Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter89Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter89Name(string $parameter89Name): self + { + $this->options['parameter89Name'] = $parameter89Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter89Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter89Value(string $parameter89Value): self + { + $this->options['parameter89Value'] = $parameter89Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter90Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter90Name(string $parameter90Name): self + { + $this->options['parameter90Name'] = $parameter90Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter90Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter90Value(string $parameter90Value): self + { + $this->options['parameter90Value'] = $parameter90Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter91Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter91Name(string $parameter91Name): self + { + $this->options['parameter91Name'] = $parameter91Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter91Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter91Value(string $parameter91Value): self + { + $this->options['parameter91Value'] = $parameter91Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter92Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter92Name(string $parameter92Name): self + { + $this->options['parameter92Name'] = $parameter92Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter92Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter92Value(string $parameter92Value): self + { + $this->options['parameter92Value'] = $parameter92Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter93Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter93Name(string $parameter93Name): self + { + $this->options['parameter93Name'] = $parameter93Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter93Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter93Value(string $parameter93Value): self + { + $this->options['parameter93Value'] = $parameter93Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter94Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter94Name(string $parameter94Name): self + { + $this->options['parameter94Name'] = $parameter94Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter94Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter94Value(string $parameter94Value): self + { + $this->options['parameter94Value'] = $parameter94Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter95Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter95Name(string $parameter95Name): self + { + $this->options['parameter95Name'] = $parameter95Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter95Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter95Value(string $parameter95Value): self + { + $this->options['parameter95Value'] = $parameter95Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter96Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter96Name(string $parameter96Name): self + { + $this->options['parameter96Name'] = $parameter96Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter96Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter96Value(string $parameter96Value): self + { + $this->options['parameter96Value'] = $parameter96Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter97Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter97Name(string $parameter97Name): self + { + $this->options['parameter97Name'] = $parameter97Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter97Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter97Value(string $parameter97Value): self + { + $this->options['parameter97Value'] = $parameter97Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter98Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter98Name(string $parameter98Name): self + { + $this->options['parameter98Name'] = $parameter98Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter98Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter98Value(string $parameter98Value): self + { + $this->options['parameter98Value'] = $parameter98Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter99Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter99Name(string $parameter99Name): self + { + $this->options['parameter99Name'] = $parameter99Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter99Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter99Value(string $parameter99Value): self + { + $this->options['parameter99Value'] = $parameter99Value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTranscriptionOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionPage.php new file mode 100644 index 0000000..ad64574 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/TranscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\Call\TranscriptionInstance + */ + public function buildInstance(array $payload): TranscriptionInstance + { + return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php new file mode 100644 index 0000000..fca02c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php new file mode 100644 index 0000000..d4e4786 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php @@ -0,0 +1,98 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessages.json'; + } + + /** + * Create the UserDefinedMessageInstance + * + * @param string $content The User Defined Message in the form of URL-encoded JSON string. + * @param array|Options $options Optional Arguments + * @return UserDefinedMessageInstance Created UserDefinedMessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $content, array $options = []): UserDefinedMessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Content' => + $content, + 'IdempotencyKey' => + $options['idempotencyKey'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserDefinedMessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php new file mode 100644 index 0000000..42e9358 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php @@ -0,0 +1,76 @@ +options['idempotencyKey'] = $idempotencyKey; + } + + /** + * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * + * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * @return $this Fluent Builder + */ + public function setIdempotencyKey(string $idempotencyKey): self + { + $this->options['idempotencyKey'] = $idempotencyKey; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateUserDefinedMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php new file mode 100644 index 0000000..fb76cd7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserDefinedMessageInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageInstance + */ + public function buildInstance(array $payload): UserDefinedMessageInstance + { + return new UserDefinedMessageInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php new file mode 100644 index 0000000..a2bb65c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessageSubscriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the UserDefinedMessageSubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php new file mode 100644 index 0000000..df8b690 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php @@ -0,0 +1,128 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 UserDefinedMessageSubscriptionContext Context for this UserDefinedMessageSubscriptionInstance + */ + protected function proxy(): UserDefinedMessageSubscriptionContext + { + if (!$this->context) { + $this->context = new UserDefinedMessageSubscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserDefinedMessageSubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php new file mode 100644 index 0000000..b55f7ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php @@ -0,0 +1,118 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessageSubscriptions.json'; + } + + /** + * Create the UserDefinedMessageSubscriptionInstance + * + * @param string $callback The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted). + * @param array|Options $options Optional Arguments + * @return UserDefinedMessageSubscriptionInstance Created UserDefinedMessageSubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $callback, array $options = []): UserDefinedMessageSubscriptionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Callback' => + $callback, + 'IdempotencyKey' => + $options['idempotencyKey'], + 'Method' => + $options['method'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserDefinedMessageSubscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a UserDefinedMessageSubscriptionContext + * + * @param string $sid The SID that uniquely identifies this User Defined Message Subscription. + */ + public function getContext( + string $sid + + ): UserDefinedMessageSubscriptionContext + { + return new UserDefinedMessageSubscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php new file mode 100644 index 0000000..c0cffec --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php @@ -0,0 +1,96 @@ +options['idempotencyKey'] = $idempotencyKey; + $this->options['method'] = $method; + } + + /** + * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * + * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * @return $this Fluent Builder + */ + public function setIdempotencyKey(string $idempotencyKey): self + { + $this->options['idempotencyKey'] = $idempotencyKey; + return $this; + } + + /** + * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. + * + * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateUserDefinedMessageSubscriptionOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php new file mode 100644 index 0000000..c6c8c1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserDefinedMessageSubscriptionInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionInstance + */ + public function buildInstance(array $payload): UserDefinedMessageSubscriptionInstance + { + return new UserDefinedMessageSubscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php new file mode 100644 index 0000000..f4c0d75 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php @@ -0,0 +1,366 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CallInstance + * + * @param array|Options $options Optional Arguments + * @return CallInstance Updated CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CallInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $options['url'], + 'Method' => + $options['method'], + 'Status' => + $options['status'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Twiml' => + $options['twiml'], + 'TimeLimit' => + $options['timeLimit'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + if (!$this->_transcriptions) { + $this->_transcriptions = new TranscriptionList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_transcriptions; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Access the userDefinedMessageSubscriptions + */ + protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList + { + if (!$this->_userDefinedMessageSubscriptions) { + $this->_userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_userDefinedMessageSubscriptions; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the userDefinedMessages + */ + protected function getUserDefinedMessages(): UserDefinedMessageList + { + if (!$this->_userDefinedMessages) { + $this->_userDefinedMessages = new UserDefinedMessageList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_userDefinedMessages; + } + + /** + * Access the siprec + */ + protected function getSiprec(): SiprecList + { + if (!$this->_siprec) { + $this->_siprec = new SiprecList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_siprec; + } + + /** + * Access the streams + */ + protected function getStreams(): StreamList + { + if (!$this->_streams) { + $this->_streams = new StreamList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_streams; + } + + /** + * Access the payments + */ + protected function getPayments(): PaymentList + { + if (!$this->_payments) { + $this->_payments = new PaymentList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_payments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php new file mode 100644 index 0000000..307b69c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php @@ -0,0 +1,285 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'parentCallSid' => Values::array_get($payload, 'parent_call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'toFormatted' => Values::array_get($payload, 'to_formatted'), + 'from' => Values::array_get($payload, 'from'), + 'fromFormatted' => Values::array_get($payload, 'from_formatted'), + 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), + 'status' => Values::array_get($payload, 'status'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'direction' => Values::array_get($payload, 'direction'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'forwardedFrom' => Values::array_get($payload, 'forwarded_from'), + 'groupSid' => Values::array_get($payload, 'group_sid'), + 'callerName' => Values::array_get($payload, 'caller_name'), + 'queueTime' => Values::array_get($payload, 'queue_time'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['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 CallContext Context for this CallInstance + */ + protected function proxy(): CallContext + { + if (!$this->context) { + $this->context = new CallContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CallInstance + * + * @param array|Options $options Optional Arguments + * @return CallInstance Updated CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CallInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + return $this->proxy()->transcriptions; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Access the userDefinedMessageSubscriptions + */ + protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList + { + return $this->proxy()->userDefinedMessageSubscriptions; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the userDefinedMessages + */ + protected function getUserDefinedMessages(): UserDefinedMessageList + { + return $this->proxy()->userDefinedMessages; + } + + /** + * Access the siprec + */ + protected function getSiprec(): SiprecList + { + return $this->proxy()->siprec; + } + + /** + * Access the streams + */ + protected function getStreams(): StreamList + { + return $this->proxy()->streams; + } + + /** + * Access the payments + */ + protected function getPayments(): PaymentList + { + return $this->proxy()->payments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php new file mode 100644 index 0000000..3092def --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php @@ -0,0 +1,293 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls.json'; + } + + /** + * Create the CallInstance + * + * @param string $to The phone number, SIP address, or client identifier to call. + * @param string $from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. + * @param array|Options $options Optional Arguments + * @return CallInstance Created CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): CallInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Method' => + $options['method'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackEvent' => + Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'SendDigits' => + $options['sendDigits'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'MachineDetection' => + $options['machineDetection'], + 'MachineDetectionTimeout' => + $options['machineDetectionTimeout'], + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'Trim' => + $options['trim'], + 'CallerId' => + $options['callerId'], + 'MachineDetectionSpeechThreshold' => + $options['machineDetectionSpeechThreshold'], + 'MachineDetectionSpeechEndThreshold' => + $options['machineDetectionSpeechEndThreshold'], + 'MachineDetectionSilenceTimeout' => + $options['machineDetectionSilenceTimeout'], + 'AsyncAmd' => + $options['asyncAmd'], + 'AsyncAmdStatusCallback' => + $options['asyncAmdStatusCallback'], + 'AsyncAmdStatusCallbackMethod' => + $options['asyncAmdStatusCallbackMethod'], + 'Byoc' => + $options['byoc'], + 'CallReason' => + $options['callReason'], + 'CallToken' => + $options['callToken'], + 'RecordingTrack' => + $options['recordingTrack'], + 'TimeLimit' => + $options['timeLimit'], + 'Url' => + $options['url'], + 'Twiml' => + $options['twiml'], + 'ApplicationSid' => + $options['applicationSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CallInstance 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 CallPage Page of CallInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CallPage + { + $options = new Values($options); + + $params = Values::of([ + '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 CallPage Page of CallInstance + */ + public function getPage(string $targetUrl): CallPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CallPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CallContext + * + * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete + */ + public function getContext( + string $sid + + ): CallContext + { + return new CallContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CallList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php new file mode 100644 index 0000000..3be856a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php @@ -0,0 +1,1064 @@ +=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return ReadCallOptions Options builder + */ + public static function read( + + string $to = Values::NONE, + string $from = Values::NONE, + string $parentCallSid = Values::NONE, + string $status = Values::NONE, + string $startTimeBefore = null, + string $startTime = null, + string $startTimeAfter = null, + string $endTimeBefore = null, + string $endTime = null, + string $endTimeAfter = null + + ): ReadCallOptions + { + return new ReadCallOptions( + $to, + $from, + $parentCallSid, + $status, + $startTimeBefore, + $startTime, + $startTimeAfter, + $endTimeBefore, + $endTime, + $endTimeAfter + ); + } + + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $status + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return UpdateCallOptions Options builder + */ + public static function update( + + string $url = Values::NONE, + string $method = Values::NONE, + string $status = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $twiml = Values::NONE, + int $timeLimit = Values::INT_NONE + + ): UpdateCallOptions + { + return new UpdateCallOptions( + $url, + $method, + $status, + $fallbackUrl, + $fallbackMethod, + $statusCallback, + $statusCallbackMethod, + $twiml, + $timeLimit + ); + } + +} + +class CreateCallOptions extends Options + { + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. + * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. + * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + */ + public function __construct( + + string $url = Values::NONE, + string $twiml = Values::NONE, + string $applicationSid = Values::NONE, + string $method = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + string $statusCallbackMethod = Values::NONE, + string $sendDigits = Values::NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + string $machineDetection = Values::NONE, + int $machineDetectionTimeout = Values::INT_NONE, + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + string $trim = Values::NONE, + string $callerId = Values::NONE, + int $machineDetectionSpeechThreshold = Values::INT_NONE, + int $machineDetectionSpeechEndThreshold = Values::INT_NONE, + int $machineDetectionSilenceTimeout = Values::INT_NONE, + string $asyncAmd = Values::NONE, + string $asyncAmdStatusCallback = Values::NONE, + string $asyncAmdStatusCallbackMethod = Values::NONE, + string $byoc = Values::NONE, + string $callReason = Values::NONE, + string $callToken = Values::NONE, + string $recordingTrack = Values::NONE, + int $timeLimit = Values::INT_NONE + + ) { + $this->options['url'] = $url; + $this->options['twiml'] = $twiml; + $this->options['applicationSid'] = $applicationSid; + $this->options['method'] = $method; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['sendDigits'] = $sendDigits; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['machineDetection'] = $machineDetection; + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['trim'] = $trim; + $this->options['callerId'] = $callerId; + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + $this->options['asyncAmd'] = $asyncAmd; + $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; + $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; + $this->options['byoc'] = $byoc; + $this->options['callReason'] = $callReason; + $this->options['callToken'] = $callToken; + $this->options['recordingTrack'] = $recordingTrack; + $this->options['timeLimit'] = $timeLimit; + } + + /** + * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @return $this Fluent Builder + */ + public function setUrl(string $url): self + { + $this->options['url'] = $url; + return $this; + } + + /** + * TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * @return $this Fluent Builder + */ + public function setTwiml(string $twiml): self + { + $this->options['twiml'] = $twiml; + return $this; + } + + /** + * The SID of the Application resource that will handle the call, if the call will be handled by an application. + * + * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. + * @return $this Fluent Builder + */ + public function setApplicationSid(string $applicationSid): self + { + $this->options['applicationSid'] = $applicationSid; + return $this; + } + + /** + * The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * + * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * + * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * @return $this Fluent Builder + */ + public function setSendDigits(string $sendDigits): self + { + $this->options['sendDigits'] = $sendDigits; + return $this; + } + + /** + * The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * + * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * + * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * + * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we call when the recording is available to be accessed. + * + * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The username used to authenticate the caller making a SIP call. + * + * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The password required to authenticate the user account specified in `sip_auth_username`. + * + * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @return $this Fluent Builder + */ + public function setMachineDetection(string $machineDetection): self + { + $this->options['machineDetection'] = $machineDetection; + return $this; + } + + /** + * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @return $this Fluent Builder + */ + public function setMachineDetectionTimeout(int $machineDetectionTimeout): self + { + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + return $this; + } + + /** + * The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * + * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * + * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * + * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * @return $this Fluent Builder + */ + public function setCallerId(string $callerId): self + { + $this->options['callerId'] = $callerId; + return $this; + } + + /** + * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self + { + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + return $this; + } + + /** + * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self + { + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + return $this; + } + + /** + * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @return $this Fluent Builder + */ + public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self + { + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + return $this; + } + + /** + * Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * + * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setAsyncAmd(string $asyncAmd): self + { + $this->options['asyncAmd'] = $asyncAmd; + return $this; + } + + /** + * The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * + * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @return $this Fluent Builder + */ + public function setAsyncAmdStatusCallback(string $asyncAmdStatusCallback): self + { + $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setAsyncAmdStatusCallbackMethod(string $asyncAmdStatusCallbackMethod): self + { + $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; + return $this; + } + + /** + * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @return $this Fluent Builder + */ + public function setByoc(string $byoc): self + { + $this->options['byoc'] = $byoc; + return $this; + } + + /** + * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @return $this Fluent Builder + */ + public function setCallReason(string $callReason): self + { + $this->options['callReason'] = $callReason; + return $this; + } + + /** + * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * @return $this Fluent Builder + */ + public function setCallToken(string $callToken): self + { + $this->options['callToken'] = $callToken; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateCallOptions ' . $options . ']'; + } +} + + + +class ReadCallOptions extends Options + { + /** + * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * @param string $parentCallSid Only include calls spawned by calls with this SID. + * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + */ + public function __construct( + + string $to = Values::NONE, + string $from = Values::NONE, + string $parentCallSid = Values::NONE, + string $status = Values::NONE, + string $startTimeBefore = null, + string $startTime = null, + string $startTimeAfter = null, + string $endTimeBefore = null, + string $endTime = null, + string $endTimeAfter = null + + ) { + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['parentCallSid'] = $parentCallSid; + $this->options['status'] = $status; + $this->options['startTimeBefore'] = $startTimeBefore; + $this->options['startTime'] = $startTime; + $this->options['startTimeAfter'] = $startTimeAfter; + $this->options['endTimeBefore'] = $endTimeBefore; + $this->options['endTime'] = $endTime; + $this->options['endTimeAfter'] = $endTimeAfter; + } + + /** + * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * + * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * + * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Only include calls spawned by calls with this SID. + * + * @param string $parentCallSid Only include calls spawned by calls with this SID. + * @return $this Fluent Builder + */ + public function setParentCallSid(string $parentCallSid): self + { + $this->options['parentCallSid'] = $parentCallSid; + return $this; + } + + /** + * The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * + * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTimeBefore(string $startTimeBefore): self + { + $this->options['startTimeBefore'] = $startTimeBefore; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTime(string $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTimeAfter(string $startTimeAfter): self + { + $this->options['startTimeAfter'] = $startTimeAfter; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTimeBefore(string $endTimeBefore): self + { + $this->options['endTimeBefore'] = $endTimeBefore; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTime(string $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTimeAfter(string $endTimeAfter): self + { + $this->options['endTimeAfter'] = $endTimeAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadCallOptions ' . $options . ']'; + } +} + +class UpdateCallOptions extends Options + { + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $status + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + */ + public function __construct( + + string $url = Values::NONE, + string $method = Values::NONE, + string $status = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $twiml = Values::NONE, + int $timeLimit = Values::INT_NONE + + ) { + $this->options['url'] = $url; + $this->options['method'] = $method; + $this->options['status'] = $status; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['twiml'] = $twiml; + $this->options['timeLimit'] = $timeLimit; + } + + /** + * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @return $this Fluent Builder + */ + public function setUrl(string $url): self + { + $this->options['url'] = $url; + return $this; + } + + /** + * The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @return $this Fluent Builder + */ + public function setTwiml(string $twiml): self + { + $this->options['twiml'] = $twiml; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateCallOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php new file mode 100644 index 0000000..d278c56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallInstance \Twilio\Rest\Api\V2010\Account\CallInstance + */ + public function buildInstance(array $payload): CallInstance + { + return new CallInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CallPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php new file mode 100644 index 0000000..93593d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php @@ -0,0 +1,163 @@ +solution = [ + 'accountSid' => + $accountSid, + 'conferenceSid' => + $conferenceSid, + 'callSid' => + $callSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants/' . \rawurlencode($callSid) + .'.json'; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Hold' => + Serialize::booleanToString($options['hold']), + 'HoldUrl' => + $options['holdUrl'], + 'HoldMethod' => + $options['holdMethod'], + 'AnnounceUrl' => + $options['announceUrl'], + 'AnnounceMethod' => + $options['announceMethod'], + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'BeepOnExit' => + Serialize::booleanToString($options['beepOnExit']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'CallSidToCoach' => + $options['callSidToCoach'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php new file mode 100644 index 0000000..5227bfc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php @@ -0,0 +1,174 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'label' => Values::array_get($payload, 'label'), + 'callSidToCoach' => Values::array_get($payload, 'call_sid_to_coach'), + 'coaching' => Values::array_get($payload, 'coaching'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endConferenceOnExit' => Values::array_get($payload, 'end_conference_on_exit'), + 'muted' => Values::array_get($payload, 'muted'), + 'hold' => Values::array_get($payload, 'hold'), + 'startConferenceOnEnter' => Values::array_get($payload, 'start_conference_on_enter'), + 'status' => Values::array_get($payload, 'status'), + 'queueTime' => Values::array_get($payload, 'queue_time'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php new file mode 100644 index 0000000..0b579a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php @@ -0,0 +1,313 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants.json'; + } + + /** + * Create the ParticipantInstance + * + * @param string $from The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint. + * @param string $to The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified. + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $from, string $to, array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'From' => + $from, + 'To' => + $to, + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'StatusCallbackEvent' => + Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), + 'Label' => + $options['label'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Beep' => + $options['beep'], + 'StartConferenceOnEnter' => + Serialize::booleanToString($options['startConferenceOnEnter']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'EarlyMedia' => + Serialize::booleanToString($options['earlyMedia']), + 'MaxParticipants' => + $options['maxParticipants'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'ConferenceStatusCallback' => + $options['conferenceStatusCallback'], + 'ConferenceStatusCallbackMethod' => + $options['conferenceStatusCallbackMethod'], + 'ConferenceStatusCallbackEvent' => + Serialize::map($options['conferenceStatusCallbackEvent'], function ($e) { return $e; }), + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'Region' => + $options['region'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'ConferenceRecordingStatusCallbackEvent' => + Serialize::map($options['conferenceRecordingStatusCallbackEvent'], function ($e) { return $e; }), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'CallSidToCoach' => + $options['callSidToCoach'], + 'JitterBufferSize' => + $options['jitterBufferSize'], + 'Byoc' => + $options['byoc'], + 'CallerId' => + $options['callerId'], + 'CallReason' => + $options['callReason'], + 'RecordingTrack' => + $options['recordingTrack'], + 'TimeLimit' => + $options['timeLimit'], + 'MachineDetection' => + $options['machineDetection'], + 'MachineDetectionTimeout' => + $options['machineDetectionTimeout'], + 'MachineDetectionSpeechThreshold' => + $options['machineDetectionSpeechThreshold'], + 'MachineDetectionSpeechEndThreshold' => + $options['machineDetectionSpeechEndThreshold'], + 'MachineDetectionSilenceTimeout' => + $options['machineDetectionSilenceTimeout'], + 'AmdStatusCallback' => + $options['amdStatusCallback'], + 'AmdStatusCallbackMethod' => + $options['amdStatusCallbackMethod'], + 'Trim' => + $options['trim'], + 'CallToken' => + $options['callToken'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Hold' => + Serialize::booleanToString($options['hold']), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. + */ + public function getContext( + string $callSid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $callSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php new file mode 100644 index 0000000..5e38866 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php @@ -0,0 +1,1228 @@ +`, ``, ``, or `` verbs. + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return UpdateParticipantOptions Options builder + */ + public static function update( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + string $holdUrl = Values::NONE, + string $holdMethod = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $beepOnExit = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE + + ): UpdateParticipantOptions + { + return new UpdateParticipantOptions( + $muted, + $hold, + $holdUrl, + $holdMethod, + $announceUrl, + $announceMethod, + $waitUrl, + $waitMethod, + $beepOnExit, + $endConferenceOnExit, + $coaching, + $callSidToCoach + ); + } + +} + +class CreateParticipantOptions extends Options + { + /** + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + */ + public function __construct( + + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + string $label = Values::NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + string $region = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + array $conferenceRecordingStatusCallbackEvent = Values::ARRAY_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE, + string $jitterBufferSize = Values::NONE, + string $byoc = Values::NONE, + string $callerId = Values::NONE, + string $callReason = Values::NONE, + string $recordingTrack = Values::NONE, + int $timeLimit = Values::INT_NONE, + string $machineDetection = Values::NONE, + int $machineDetectionTimeout = Values::INT_NONE, + int $machineDetectionSpeechThreshold = Values::INT_NONE, + int $machineDetectionSpeechEndThreshold = Values::INT_NONE, + int $machineDetectionSilenceTimeout = Values::INT_NONE, + string $amdStatusCallback = Values::NONE, + string $amdStatusCallbackMethod = Values::NONE, + string $trim = Values::NONE, + string $callToken = Values::NONE + + ) { + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['label'] = $label; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['region'] = $region; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; + $this->options['coaching'] = $coaching; + $this->options['callSidToCoach'] = $callSidToCoach; + $this->options['jitterBufferSize'] = $jitterBufferSize; + $this->options['byoc'] = $byoc; + $this->options['callerId'] = $callerId; + $this->options['callReason'] = $callReason; + $this->options['recordingTrack'] = $recordingTrack; + $this->options['timeLimit'] = $timeLimit; + $this->options['machineDetection'] = $machineDetection; + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + $this->options['amdStatusCallback'] = $amdStatusCallback; + $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; + $this->options['trim'] = $trim; + $this->options['callToken'] = $callToken; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * + * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * + * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * @return $this Fluent Builder + */ + public function setLabel(string $label): self + { + $this->options['label'] = $label; + return $this; + } + + /** + * The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * + * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * + * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * + * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * + * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * + * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackEvent(array $conferenceRecordingStatusCallbackEvent): self + { + $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; + return $this; + } + + /** + * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return $this Fluent Builder + */ + public function setCallSidToCoach(string $callSidToCoach): self + { + $this->options['callSidToCoach'] = $callSidToCoach; + return $this; + } + + /** + * Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * + * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * @return $this Fluent Builder + */ + public function setJitterBufferSize(string $jitterBufferSize): self + { + $this->options['jitterBufferSize'] = $jitterBufferSize; + return $this; + } + + /** + * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @return $this Fluent Builder + */ + public function setByoc(string $byoc): self + { + $this->options['byoc'] = $byoc; + return $this; + } + + /** + * The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * + * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * @return $this Fluent Builder + */ + public function setCallerId(string $callerId): self + { + $this->options['callerId'] = $callerId; + return $this; + } + + /** + * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @return $this Fluent Builder + */ + public function setCallReason(string $callReason): self + { + $this->options['callReason'] = $callReason; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @return $this Fluent Builder + */ + public function setMachineDetection(string $machineDetection): self + { + $this->options['machineDetection'] = $machineDetection; + return $this; + } + + /** + * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @return $this Fluent Builder + */ + public function setMachineDetectionTimeout(int $machineDetectionTimeout): self + { + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + return $this; + } + + /** + * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self + { + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + return $this; + } + + /** + * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self + { + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + return $this; + } + + /** + * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @return $this Fluent Builder + */ + public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self + { + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + return $this; + } + + /** + * The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * + * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @return $this Fluent Builder + */ + public function setAmdStatusCallback(string $amdStatusCallback): self + { + $this->options['amdStatusCallback'] = $amdStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setAmdStatusCallbackMethod(string $amdStatusCallbackMethod): self + { + $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; + return $this; + } + + /** + * Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * + * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * @return $this Fluent Builder + */ + public function setCallToken(string $callToken): self + { + $this->options['callToken'] = $callToken; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateParticipantOptions ' . $options . ']'; + } +} + + + +class ReadParticipantOptions extends Options + { + /** + * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. + * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. + * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. + */ + public function __construct( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE + + ) { + $this->options['muted'] = $muted; + $this->options['hold'] = $hold; + $this->options['coaching'] = $coaching; + } + + /** + * Whether to return only participants that are muted. Can be: `true` or `false`. + * + * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to return only participants that are on hold. Can be: `true` or `false`. + * + * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setHold(bool $hold): self + { + $this->options['hold'] = $hold; + return $this; + } + + /** + * Whether to return only participants who are coaching another call. Can be: `true` or `false`. + * + * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadParticipantOptions ' . $options . ']'; + } +} + +class UpdateParticipantOptions extends Options + { + /** + * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + */ + public function __construct( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + string $holdUrl = Values::NONE, + string $holdMethod = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $beepOnExit = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE + + ) { + $this->options['muted'] = $muted; + $this->options['hold'] = $hold; + $this->options['holdUrl'] = $holdUrl; + $this->options['holdMethod'] = $holdMethod; + $this->options['announceUrl'] = $announceUrl; + $this->options['announceMethod'] = $announceMethod; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['beepOnExit'] = $beepOnExit; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['coaching'] = $coaching; + $this->options['callSidToCoach'] = $callSidToCoach; + } + + /** + * Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * + * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * + * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * @return $this Fluent Builder + */ + public function setHold(bool $hold): self + { + $this->options['hold'] = $hold; + return $this; + } + + /** + * The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setHoldUrl(string $holdUrl): self + { + $this->options['holdUrl'] = $holdUrl; + return $this; + } + + /** + * The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @return $this Fluent Builder + */ + public function setHoldMethod(string $holdMethod): self + { + $this->options['holdMethod'] = $holdMethod; + return $this; + } + + /** + * The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setAnnounceUrl(string $announceUrl): self + { + $this->options['announceUrl'] = $announceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setAnnounceMethod(string $announceMethod): self + { + $this->options['announceMethod'] = $announceMethod; + return $this; + } + + /** + * The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setBeepOnExit(bool $beepOnExit): self + { + $this->options['beepOnExit'] = $beepOnExit; + return $this; + } + + /** + * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return $this Fluent Builder + */ + public function setCallSidToCoach(string $callSidToCoach): self + { + $this->options['callSidToCoach'] = $callSidToCoach; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php new file mode 100644 index 0000000..84513da --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Api\V2010\Account\Conference\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php new file mode 100644 index 0000000..b39cff9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php @@ -0,0 +1,143 @@ +solution = [ + 'accountSid' => + $accountSid, + 'conferenceSid' => + $conferenceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'PauseBehavior' => + $options['pauseBehavior'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php new file mode 100644 index 0000000..52f3ee7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php @@ -0,0 +1,179 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + return $this->proxy()->update($status, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php new file mode 100644 index 0000000..dd9d1b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php @@ -0,0 +1,187 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Recordings.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance 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 RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + '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 RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php new file mode 100644 index 0000000..19922d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php @@ -0,0 +1,168 @@ +=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return UpdateRecordingOptions Options builder + */ + public static function update( + + string $pauseBehavior = Values::NONE + + ): UpdateRecordingOptions + { + return new UpdateRecordingOptions( + $pauseBehavior + ); + } + +} + + + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + +class UpdateRecordingOptions extends Options + { + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + */ + public function __construct( + + string $pauseBehavior = Values::NONE + + ) { + $this->options['pauseBehavior'] = $pauseBehavior; + } + + /** + * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return $this Fluent Builder + */ + public function setPauseBehavior(string $pauseBehavior): self + { + $this->options['pauseBehavior'] = $pauseBehavior; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php new file mode 100644 index 0000000..9128fa4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Conference\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php new file mode 100644 index 0000000..47faa7f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConferenceInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceInstance Updated ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConferenceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'AnnounceUrl' => + $options['announceUrl'], + 'AnnounceMethod' => + $options['announceMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConferenceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php new file mode 100644 index 0000000..19743a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php @@ -0,0 +1,175 @@ +properties = [ + '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'), + 'reasonConferenceEnded' => Values::array_get($payload, 'reason_conference_ended'), + 'callSidEndingConference' => Values::array_get($payload, 'call_sid_ending_conference'), + ]; + + $this->solution = ['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 ConferenceContext Context for this ConferenceInstance + */ + protected function proxy(): ConferenceContext + { + if (!$this->context) { + $this->context = new ConferenceContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConferenceInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceInstance Updated ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConferenceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConferenceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php new file mode 100644 index 0000000..5113512 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php @@ -0,0 +1,190 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceInstance 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 ConferencePage Page of ConferenceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferencePage + { + $options = new Values($options); + + $params = Values::of([ + '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 ConferencePage Page of ConferenceInstance + */ + public function getPage(string $targetUrl): ConferencePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferencePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch + */ + public function getContext( + string $sid + + ): ConferenceContext + { + return new ConferenceContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConferenceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php new file mode 100644 index 0000000..88bbc26 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php @@ -0,0 +1,290 @@ +=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateCreated Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateUpdatedBefore Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $dateUpdated Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $dateUpdatedAfter Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $friendlyName The string that identifies the Conference resources to read. + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * @return ReadConferenceOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $dateUpdatedBefore = null, + string $dateUpdated = null, + string $dateUpdatedAfter = null, + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ): ReadConferenceOptions + { + return new ReadConferenceOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter, + $dateUpdatedBefore, + $dateUpdated, + $dateUpdatedAfter, + $friendlyName, + $status + ); + } + + /** + * @param string $status + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * @return UpdateConferenceOptions Options builder + */ + public static function update( + + string $status = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE + + ): UpdateConferenceOptions + { + return new UpdateConferenceOptions( + $status, + $announceUrl, + $announceMethod + ); + } + +} + + +class ReadConferenceOptions extends Options + { + /** + * @param string $dateCreatedBefore Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateCreated Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @param string $dateUpdatedBefore Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $dateUpdated Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $dateUpdatedAfter Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @param string $friendlyName The string that identifies the Conference resources to read. + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $dateUpdatedBefore = null, + string $dateUpdated = null, + string $dateUpdatedAfter = null, + string $friendlyName = Values::NONE, + string $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 include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * + * @param string $dateCreatedBefore Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * + * @param string $dateCreated Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * + * @param string $dateCreatedAfter Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * + * @param string $dateUpdatedBefore Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateUpdatedBefore(string $dateUpdatedBefore): self + { + $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; + return $this; + } + + /** + * Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * + * @param string $dateUpdated Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateUpdated(string $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * + * @param string $dateUpdatedAfter Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateUpdatedAfter(string $dateUpdatedAfter): self + { + $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; + return $this; + } + + /** + * The string that identifies the Conference resources to read. + * + * @param string $friendlyName The string that identifies the Conference resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadConferenceOptions ' . $options . ']'; + } +} + +class UpdateConferenceOptions extends Options + { + /** + * @param string $status + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + */ + public function __construct( + + string $status = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['announceUrl'] = $announceUrl; + $this->options['announceMethod'] = $announceMethod; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setAnnounceUrl(string $announceUrl): self + { + $this->options['announceUrl'] = $announceUrl; + return $this; + } + + /** + * The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * @return $this Fluent Builder + */ + public function setAnnounceMethod(string $announceMethod): self + { + $this->options['announceMethod'] = $announceMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateConferenceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php new file mode 100644 index 0000000..184cf96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceInstance \Twilio\Rest\Api\V2010\Account\ConferenceInstance + */ + public function buildInstance(array $payload): ConferenceInstance + { + return new ConferenceInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConferencePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php new file mode 100644 index 0000000..af30b78 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php @@ -0,0 +1,147 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/ConnectApps/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the ConnectAppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConnectAppInstance + * + * @return ConnectAppInstance Fetched ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectAppInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectAppInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectAppInstance Updated ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectAppInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthorizeRedirectUrl' => + $options['authorizeRedirectUrl'], + 'CompanyName' => + $options['companyName'], + 'DeauthorizeCallbackMethod' => + $options['deauthorizeCallbackMethod'], + 'DeauthorizeCallbackUrl' => + $options['deauthorizeCallbackUrl'], + 'Description' => + $options['description'], + 'FriendlyName' => + $options['friendlyName'], + 'HomepageUrl' => + $options['homepageUrl'], + 'Permissions' => + $options['permissions'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConnectAppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php new file mode 100644 index 0000000..2386538 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php @@ -0,0 +1,163 @@ +properties = [ + '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 = ['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 ConnectAppContext Context for this ConnectAppInstance + */ + protected function proxy(): ConnectAppContext + { + if (!$this->context) { + $this->context = new ConnectAppContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectAppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectAppInstance + * + * @return ConnectAppInstance Fetched ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectAppInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectAppInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectAppInstance Updated ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectAppInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConnectAppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php new file mode 100644 index 0000000..8208489 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/ConnectApps.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ConnectAppPage Page of ConnectAppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectAppPage + { + + $params = Values::of([ + '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 ConnectAppPage Page of ConnectAppInstance + */ + public function getPage(string $targetUrl): ConnectAppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectAppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectAppContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. + */ + public function getContext( + string $sid + + ): ConnectAppContext + { + return new ConnectAppContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConnectAppList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php new file mode 100644 index 0000000..3a6f7a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php @@ -0,0 +1,208 @@ +options['authorizeRedirectUrl'] = $authorizeRedirectUrl; + $this->options['companyName'] = $companyName; + $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; + $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; + $this->options['description'] = $description; + $this->options['friendlyName'] = $friendlyName; + $this->options['homepageUrl'] = $homepageUrl; + $this->options['permissions'] = $permissions; + } + + /** + * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. + * + * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. + * @return $this Fluent Builder + */ + public function setAuthorizeRedirectUrl(string $authorizeRedirectUrl): self + { + $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; + return $this; + } + + /** + * The company name to set for the Connect App. + * + * @param string $companyName The company name to set for the Connect App. + * @return $this Fluent Builder + */ + public function setCompanyName(string $companyName): self + { + $this->options['companyName'] = $companyName; + return $this; + } + + /** + * The HTTP method to use when calling `deauthorize_callback_url`. + * + * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. + * @return $this Fluent Builder + */ + public function setDeauthorizeCallbackMethod(string $deauthorizeCallbackMethod): self + { + $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; + return $this; + } + + /** + * The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. + * + * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. + * @return $this Fluent Builder + */ + public function setDeauthorizeCallbackUrl(string $deauthorizeCallbackUrl): self + { + $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; + return $this; + } + + /** + * A description of the Connect App. + * + * @param string $description A description of the Connect App. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A public URL where users can obtain more information about this Connect App. + * + * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. + * @return $this Fluent Builder + */ + public function setHomepageUrl(string $homepageUrl): self + { + $this->options['homepageUrl'] = $homepageUrl; + return $this; + } + + /** + * A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. + * + * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. + * @return $this Fluent Builder + */ + public function setPermissions(array $permissions): self + { + $this->options['permissions'] = $permissions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateConnectAppOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php new file mode 100644 index 0000000..b99005d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectAppInstance \Twilio\Rest\Api\V2010\Account\ConnectAppInstance + */ + public function buildInstance(array $payload): ConnectAppInstance + { + return new ConnectAppInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConnectAppPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php new file mode 100644 index 0000000..75478f4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php @@ -0,0 +1,101 @@ +solution = [ + 'accountSid' => + $accountSid, + 'resourceSid' => + $resourceSid, + 'assignedAddOnSid' => + $assignedAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the AssignedAddOnExtensionInstance + * + * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnExtensionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php new file mode 100644 index 0000000..2f64423 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php @@ -0,0 +1,137 @@ +properties = [ + '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 = ['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 AssignedAddOnExtensionContext Context for this AssignedAddOnExtensionInstance + */ + protected function proxy(): AssignedAddOnExtensionContext + { + 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 the AssignedAddOnExtensionInstance + * + * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnExtensionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php new file mode 100644 index 0000000..c17333b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'resourceSid' => + $resourceSid, + + 'assignedAddOnSid' => + $assignedAddOnSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) + .'/Extensions.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssignedAddOnExtensionPage + { + + $params = Values::of([ + '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 AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance + */ + public function getPage(string $targetUrl): AssignedAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssignedAddOnExtensionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. + */ + public function getContext( + string $sid + + ): AssignedAddOnExtensionContext + { + 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(): string + { + return '[Twilio.Api.V2010.AssignedAddOnExtensionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php new file mode 100644 index 0000000..ac97a19 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssignedAddOnExtensionInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionInstance + */ + public function buildInstance(array $payload): AssignedAddOnExtensionInstance + { + 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(): string + { + return '[Twilio.Api.V2010.AssignedAddOnExtensionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php new file mode 100644 index 0000000..eabf69d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php @@ -0,0 +1,169 @@ +solution = [ + 'accountSid' => + $accountSid, + 'resourceSid' => + $resourceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AssignedAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AssignedAddOnInstance + * + * @return AssignedAddOnInstance Fetched AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AssignedAddOnInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): AssignedAddOnExtensionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php new file mode 100644 index 0000000..b3a4ee6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php @@ -0,0 +1,163 @@ +properties = [ + '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 = ['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 AssignedAddOnContext Context for this AssignedAddOnInstance + */ + protected function proxy(): AssignedAddOnContext + { + if (!$this->context) { + $this->context = new AssignedAddOnContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssignedAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssignedAddOnInstance + * + * @return AssignedAddOnInstance Fetched AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the extensions + */ + protected function getExtensions(): AssignedAddOnExtensionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php new file mode 100644 index 0000000..b1505a1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'resourceSid' => + $resourceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns.json'; + } + + /** + * Create the AssignedAddOnInstance + * + * @param string $installedAddOnSid The SID that identifies the Add-on installation. + * @return AssignedAddOnInstance Created AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $installedAddOnSid): AssignedAddOnInstance + { + + $data = Values::of([ + 'InstalledAddOnSid' => + $installedAddOnSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AssignedAddOnInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['resourceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AssignedAddOnPage Page of AssignedAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssignedAddOnPage + { + + $params = Values::of([ + '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 AssignedAddOnPage Page of AssignedAddOnInstance + */ + public function getPage(string $targetUrl): AssignedAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssignedAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssignedAddOnContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): AssignedAddOnContext + { + return new AssignedAddOnContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php new file mode 100644 index 0000000..79c6c89 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssignedAddOnInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnInstance + */ + public function buildInstance(array $payload): AssignedAddOnInstance + { + return new AssignedAddOnInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php new file mode 100644 index 0000000..b2051cd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php @@ -0,0 +1,149 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + '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'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php new file mode 100644 index 0000000..3d59ae3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php @@ -0,0 +1,239 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/Local.json'; + } + + /** + * Create the LocalInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return LocalInstance Created LocalInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): LocalInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new LocalInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LocalInstance 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 LocalPage Page of LocalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LocalPage + { + $options = new Values($options); + + $params = Values::of([ + '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 LocalPage Page of LocalInstance + */ + public function getPage(string $targetUrl): LocalPage + { + $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(): string + { + return '[Twilio.Api.V2010.LocalList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php new file mode 100644 index 0000000..8ac638a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateLocalOptions ' . $options . ']'; + } +} + +class ReadLocalOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php new file mode 100644 index 0000000..29ecbb4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LocalInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalInstance + */ + public function buildInstance(array $payload): LocalInstance + { + return new LocalInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php new file mode 100644 index 0000000..4b369b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php @@ -0,0 +1,149 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + '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'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php new file mode 100644 index 0000000..d5746d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php @@ -0,0 +1,239 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/Mobile.json'; + } + + /** + * Create the MobileInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return MobileInstance Created MobileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): MobileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MobileInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MobileInstance 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 MobilePage Page of MobileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MobilePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MobilePage Page of MobileInstance + */ + public function getPage(string $targetUrl): MobilePage + { + $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(): string + { + return '[Twilio.Api.V2010.MobileList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php new file mode 100644 index 0000000..fbdae7b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateMobileOptions ' . $options . ']'; + } +} + +class ReadMobileOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php new file mode 100644 index 0000000..7bf4812 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MobileInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileInstance + */ + public function buildInstance(array $payload): MobileInstance + { + return new MobileInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobilePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php new file mode 100644 index 0000000..f4f80aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php @@ -0,0 +1,149 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + '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'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php new file mode 100644 index 0000000..6e09325 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php @@ -0,0 +1,239 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/TollFree.json'; + } + + /** + * Create the TollFreeInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return TollFreeInstance Created TollFreeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): TollFreeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TollFreeInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollFreeInstance 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 TollFreePage Page of TollFreeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollFreePage + { + $options = new Values($options); + + $params = Values::of([ + '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 TollFreePage Page of TollFreeInstance + */ + public function getPage(string $targetUrl): TollFreePage + { + $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(): string + { + return '[Twilio.Api.V2010.TollFreeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php new file mode 100644 index 0000000..2f363e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTollFreeOptions ' . $options . ']'; + } +} + +class ReadTollFreeOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php new file mode 100644 index 0000000..d7aa9e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeInstance + */ + public function buildInstance(array $payload): TollFreeInstance + { + return new TollFreeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php new file mode 100644 index 0000000..1999294 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php @@ -0,0 +1,237 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IncomingPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IncomingPhoneNumberInstance + * + * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IncomingPhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IncomingPhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AccountSid' => + $options['accountSid'], + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the assignedAddOns + */ + protected function getAssignedAddOns(): AssignedAddOnList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IncomingPhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php new file mode 100644 index 0000000..bdf4aaa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php @@ -0,0 +1,222 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + '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'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['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 IncomingPhoneNumberContext Context for this IncomingPhoneNumberInstance + */ + protected function proxy(): IncomingPhoneNumberContext + { + if (!$this->context) { + $this->context = new IncomingPhoneNumberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IncomingPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IncomingPhoneNumberInstance + * + * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IncomingPhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IncomingPhoneNumberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the assignedAddOns + */ + protected function getAssignedAddOns(): AssignedAddOnList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IncomingPhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php new file mode 100644 index 0000000..5d75b18 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php @@ -0,0 +1,347 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers.json'; + } + + /** + * Create the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Created IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): IncomingPhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + 'PhoneNumber' => + $options['phoneNumber'], + 'AreaCode' => + $options['areaCode'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IncomingPhoneNumberInstance 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 IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IncomingPhoneNumberPage + { + $options = new Values($options); + + $params = Values::of([ + '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 IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance + */ + public function getPage(string $targetUrl): IncomingPhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IncomingPhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IncomingPhoneNumberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): IncomingPhoneNumberContext + { + return new IncomingPhoneNumberContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + if (!$this->_tollFree) { + $this->_tollFree = new TollFreeList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_tollFree; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + if (!$this->_local) { + $this->_local = new LocalList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_local; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + if (!$this->_mobile) { + $this->_mobile = new MobileList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_mobile; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.IncomingPhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php new file mode 100644 index 0000000..eda5d8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php @@ -0,0 +1,1040 @@ +options['phoneNumber'] = $phoneNumber; + $this->options['areaCode'] = $areaCode; + $this->options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). + * + * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). + * @return $this Fluent Builder + */ + public function setAreaCode(string $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateIncomingPhoneNumberOptions ' . $options . ']'; + } +} + + + +class ReadIncomingPhoneNumberOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the IncomingPhoneNumber resources to read. + * + * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadIncomingPhoneNumberOptions ' . $options . ']'; + } +} + +class UpdateIncomingPhoneNumberOptions extends Options + { + /** + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @param string $emergencyStatus + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. + * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @param string $voiceReceiveMode + * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + public function __construct( + + string $accountSid = Values::NONE, + string $apiVersion = Values::NONE, + string $friendlyName = Values::NONE, + string $smsApplicationSid = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $voiceApplicationSid = Values::NONE, + bool $voiceCallerIdLookup = Values::BOOL_NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceUrl = Values::NONE, + string $emergencyStatus = Values::NONE, + string $emergencyAddressSid = Values::NONE, + string $trunkSid = Values::NONE, + string $voiceReceiveMode = Values::NONE, + string $identitySid = Values::NONE, + string $addressSid = Values::NONE, + string $bundleSid = Values::NONE + + ) { + $this->options['accountSid'] = $accountSid; + $this->options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from this phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateIncomingPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php new file mode 100644 index 0000000..361c9c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IncomingPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance + */ + public function buildInstance(array $payload): IncomingPhoneNumberInstance + { + return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IncomingPhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php new file mode 100644 index 0000000..be6cf1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php @@ -0,0 +1,133 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.KeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php new file mode 100644 index 0000000..eb3789e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 KeyContext Context for this KeyInstance + */ + protected function proxy(): KeyContext + { + if (!$this->context) { + $this->context = new KeyContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.KeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php new file mode 100644 index 0000000..f2e0985 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 KeyPage Page of KeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): KeyPage + { + + $params = Values::of([ + '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 KeyPage Page of KeyInstance + */ + public function getPage(string $targetUrl): KeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new KeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a KeyContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. + */ + public function getContext( + string $sid + + ): KeyContext + { + return new KeyContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.KeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php new file mode 100644 index 0000000..da5a74f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php @@ -0,0 +1,82 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php new file mode 100644 index 0000000..ee893ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return KeyInstance \Twilio\Rest\Api\V2010\Account\KeyInstance + */ + public function buildInstance(array $payload): KeyInstance + { + return new KeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.KeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php new file mode 100644 index 0000000..868bedb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php @@ -0,0 +1,93 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php new file mode 100644 index 0000000..6518eda --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php @@ -0,0 +1,95 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Feedback.json'; + } + + /** + * Create the FeedbackInstance + * + * @param array|Options $options Optional Arguments + * @return FeedbackInstance Created FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): FeedbackInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Outcome' => + $options['outcome'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FeedbackInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['messageSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php new file mode 100644 index 0000000..96d92c7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php @@ -0,0 +1,74 @@ +options['outcome'] = $outcome; + } + + /** + * @param string $outcome + * @return $this Fluent Builder + */ + public function setOutcome(string $outcome): self + { + $this->options['outcome'] = $outcome; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateFeedbackOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php new file mode 100644 index 0000000..36db577 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FeedbackInstance \Twilio\Rest\Api\V2010\Account\Message\FeedbackInstance + */ + public function buildInstance(array $payload): FeedbackInstance + { + return new FeedbackInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php new file mode 100644 index 0000000..32ef982 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Media/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the MediaInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MediaInstance + * + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MediaContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php new file mode 100644 index 0000000..8a0d886 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php @@ -0,0 +1,144 @@ +properties = [ + '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 = ['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 MediaContext Context for this MediaInstance + */ + protected function proxy(): MediaContext + { + if (!$this->context) { + $this->context = new MediaContext( + $this->version, + $this->solution['accountSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MediaInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MediaInstance + * + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MediaInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php new file mode 100644 index 0000000..cba493b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php @@ -0,0 +1,187 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Media.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MediaInstance 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 MediaPage Page of MediaInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MediaPage + { + $options = new Values($options); + + $params = Values::of([ + '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 MediaPage Page of MediaInstance + */ + public function getPage(string $targetUrl): MediaPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MediaPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MediaContext + * + * @param string $sid The unique identifier of the to-be-deleted Media resource. + */ + public function getContext( + string $sid + + ): MediaContext + { + return new MediaContext( + $this->version, + $this->solution['accountSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MediaList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php new file mode 100644 index 0000000..d1fc7da --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php @@ -0,0 +1,116 @@ +=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @return ReadMediaOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadMediaOptions + { + return new ReadMediaOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + +} + + + +class ReadMediaOptions extends Options + { + /** + * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * + * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * + * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * + * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMediaOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php new file mode 100644 index 0000000..74a121b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MediaInstance \Twilio\Rest\Api\V2010\Account\Message\MediaInstance + */ + public function buildInstance(array $payload): MediaInstance + { + return new MediaInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MediaPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php new file mode 100644 index 0000000..f65c1a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php @@ -0,0 +1,213 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Status' => + $options['status'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + if (!$this->_feedback) { + $this->_feedback = new FeedbackList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_feedback; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + if (!$this->_media) { + $this->_media = new MediaList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_media; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php new file mode 100644 index 0000000..6e4c601 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'body' => Values::array_get($payload, 'body'), + 'numSegments' => Values::array_get($payload, 'num_segments'), + 'direction' => Values::array_get($payload, 'direction'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'price' => Values::array_get($payload, 'price'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + 'uri' => Values::array_get($payload, 'uri'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'numMedia' => Values::array_get($payload, 'num_media'), + 'status' => Values::array_get($payload, 'status'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateSent' => Deserialize::dateTime(Values::array_get($payload, 'date_sent')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['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 MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + return $this->proxy()->feedback; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php new file mode 100644 index 0000000..b4b0980 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php @@ -0,0 +1,258 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages.json'; + } + + /** + * Create the MessageInstance + * + * @param string $to The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'StatusCallback' => + $options['statusCallback'], + 'ApplicationSid' => + $options['applicationSid'], + 'MaxPrice' => + $options['maxPrice'], + 'ProvideFeedback' => + Serialize::booleanToString($options['provideFeedback']), + 'Attempt' => + $options['attempt'], + 'ValidityPeriod' => + $options['validityPeriod'], + 'ForceDelivery' => + Serialize::booleanToString($options['forceDelivery']), + 'ContentRetention' => + $options['contentRetention'], + 'AddressRetention' => + $options['addressRetention'], + 'SmartEncoded' => + Serialize::booleanToString($options['smartEncoded']), + 'PersistentAction' => + Serialize::map($options['persistentAction'], function ($e) { return $e; }), + 'ShortenUrls' => + Serialize::booleanToString($options['shortenUrls']), + 'ScheduleType' => + $options['scheduleType'], + 'SendAt' => + Serialize::iso8601DateTime($options['sendAt']), + 'SendAsMms' => + Serialize::booleanToString($options['sendAsMms']), + 'ContentVariables' => + $options['contentVariables'], + 'RiskCheck' => + $options['riskCheck'], + 'From' => + $options['from'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'Body' => + $options['body'], + 'MediaUrl' => + Serialize::map($options['mediaUrl'], function ($e) { return $e; }), + 'ContentSid' => + $options['contentSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The SID of the Message resource you wish to delete + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php new file mode 100644 index 0000000..0f68786 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php @@ -0,0 +1,642 @@ +=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @return ReadMessageOptions Options builder + */ + public static function read( + + string $to = Values::NONE, + string $from = Values::NONE, + string $dateSentBefore = null, + string $dateSent = null, + string $dateSentAfter = null + + ): ReadMessageOptions + { + return new ReadMessageOptions( + $to, + $from, + $dateSentBefore, + $dateSent, + $dateSentAfter + ); + } + + /** + * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string + * @param string $status + * @return UpdateMessageOptions Options builder + */ + public static function update( + + string $body = Values::NONE, + string $status = Values::NONE + + ): UpdateMessageOptions + { + return new UpdateMessageOptions( + $body, + $status + ); + } + +} + +class CreateMessageOptions extends Options + { + /** + * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. + * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). + * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). + * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). + * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. + * @param string $maxPrice [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. + * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. + * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used + * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) + * @param bool $forceDelivery Reserved + * @param string $contentRetention + * @param string $addressRetention + * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). + * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + * @param string $scheduleType + * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. + * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. + * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. + * @param string $riskCheck + */ + public function __construct( + + string $from = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $body = Values::NONE, + array $mediaUrl = Values::ARRAY_NONE, + string $contentSid = Values::NONE, + string $statusCallback = Values::NONE, + string $applicationSid = Values::NONE, + string $maxPrice = Values::NONE, + bool $provideFeedback = Values::BOOL_NONE, + int $attempt = Values::INT_NONE, + int $validityPeriod = Values::INT_NONE, + bool $forceDelivery = Values::BOOL_NONE, + string $contentRetention = Values::NONE, + string $addressRetention = Values::NONE, + bool $smartEncoded = Values::BOOL_NONE, + array $persistentAction = Values::ARRAY_NONE, + bool $shortenUrls = Values::BOOL_NONE, + string $scheduleType = Values::NONE, + \DateTime $sendAt = null, + bool $sendAsMms = Values::BOOL_NONE, + string $contentVariables = Values::NONE, + string $riskCheck = Values::NONE + + ) { + $this->options['from'] = $from; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['body'] = $body; + $this->options['mediaUrl'] = $mediaUrl; + $this->options['contentSid'] = $contentSid; + $this->options['statusCallback'] = $statusCallback; + $this->options['applicationSid'] = $applicationSid; + $this->options['maxPrice'] = $maxPrice; + $this->options['provideFeedback'] = $provideFeedback; + $this->options['attempt'] = $attempt; + $this->options['validityPeriod'] = $validityPeriod; + $this->options['forceDelivery'] = $forceDelivery; + $this->options['contentRetention'] = $contentRetention; + $this->options['addressRetention'] = $addressRetention; + $this->options['smartEncoded'] = $smartEncoded; + $this->options['persistentAction'] = $persistentAction; + $this->options['shortenUrls'] = $shortenUrls; + $this->options['scheduleType'] = $scheduleType; + $this->options['sendAt'] = $sendAt; + $this->options['sendAsMms'] = $sendAsMms; + $this->options['contentVariables'] = $contentVariables; + $this->options['riskCheck'] = $riskCheck; + } + + /** + * The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + * + * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). + * + * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + * + * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + * @return $this Fluent Builder + */ + public function setMediaUrl(array $mediaUrl): self + { + $this->options['mediaUrl'] = $mediaUrl; + return $this; + } + + /** + * For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). + * + * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). + * + * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. + * + * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. + * @return $this Fluent Builder + */ + public function setApplicationSid(string $applicationSid): self + { + $this->options['applicationSid'] = $applicationSid; + return $this; + } + + /** + * [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. + * + * @param string $maxPrice [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. + * @return $this Fluent Builder + */ + public function setMaxPrice(string $maxPrice): self + { + $this->options['maxPrice'] = $maxPrice; + return $this; + } + + /** + * Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. + * + * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. + * @return $this Fluent Builder + */ + public function setProvideFeedback(bool $provideFeedback): self + { + $this->options['provideFeedback'] = $provideFeedback; + return $this; + } + + /** + * Total number of attempts made (including this request) to send the message regardless of the provider used + * + * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used + * @return $this Fluent Builder + */ + public function setAttempt(int $attempt): self + { + $this->options['attempt'] = $attempt; + return $this; + } + + /** + * The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) + * + * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved + * + * @param bool $forceDelivery Reserved + * @return $this Fluent Builder + */ + public function setForceDelivery(bool $forceDelivery): self + { + $this->options['forceDelivery'] = $forceDelivery; + return $this; + } + + /** + * @param string $contentRetention + * @return $this Fluent Builder + */ + public function setContentRetention(string $contentRetention): self + { + $this->options['contentRetention'] = $contentRetention; + return $this; + } + + /** + * @param string $addressRetention + * @return $this Fluent Builder + */ + public function setAddressRetention(string $addressRetention): self + { + $this->options['addressRetention'] = $addressRetention; + return $this; + } + + /** + * Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * + * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmartEncoded(bool $smartEncoded): self + { + $this->options['smartEncoded'] = $smartEncoded; + return $this; + } + + /** + * Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). + * + * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). + * @return $this Fluent Builder + */ + public function setPersistentAction(array $persistentAction): self + { + $this->options['persistentAction'] = $persistentAction; + return $this; + } + + /** + * For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + * + * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + * @return $this Fluent Builder + */ + public function setShortenUrls(bool $shortenUrls): self + { + $this->options['shortenUrls'] = $shortenUrls; + return $this; + } + + /** + * @param string $scheduleType + * @return $this Fluent Builder + */ + public function setScheduleType(string $scheduleType): self + { + $this->options['scheduleType'] = $scheduleType; + return $this; + } + + /** + * The time that Twilio will send the message. Must be in ISO 8601 format. + * + * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setSendAt(\DateTime $sendAt): self + { + $this->options['sendAt'] = $sendAt; + return $this; + } + + /** + * If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. + * + * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. + * @return $this Fluent Builder + */ + public function setSendAsMms(bool $sendAsMms): self + { + $this->options['sendAsMms'] = $sendAsMms; + return $this; + } + + /** + * For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. + * + * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * @param string $riskCheck + * @return $this Fluent Builder + */ + public function setRiskCheck(string $riskCheck): self + { + $this->options['riskCheck'] = $riskCheck; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` + * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` + * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + */ + public function __construct( + + string $to = Values::NONE, + string $from = Values::NONE, + string $dateSentBefore = null, + string $dateSent = null, + string $dateSentAfter = null + + ) { + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['dateSentBefore'] = $dateSentBefore; + $this->options['dateSent'] = $dateSent; + $this->options['dateSentAfter'] = $dateSentAfter; + } + + /** + * Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` + * + * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` + * + * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * + * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @return $this Fluent Builder + */ + public function setDateSentBefore(string $dateSentBefore): self + { + $this->options['dateSentBefore'] = $dateSentBefore; + return $this; + } + + /** + * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * + * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @return $this Fluent Builder + */ + public function setDateSent(string $dateSent): self + { + $this->options['dateSent'] = $dateSent; + return $this; + } + + /** + * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * + * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + * @return $this Fluent Builder + */ + public function setDateSentAfter(string $dateSentAfter): self + { + $this->options['dateSentAfter'] = $dateSentAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string + * @param string $status + */ + public function __construct( + + string $body = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['status'] = $status; + } + + /** + * The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string + * + * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php new file mode 100644 index 0000000..b07c10d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Api\V2010\Account\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php new file mode 100644 index 0000000..aa4680e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php @@ -0,0 +1,90 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php new file mode 100644 index 0000000..f2d3365 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php @@ -0,0 +1,88 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys.json'; + } + + /** + * Create the NewKeyInstance + * + * @param array|Options $options Optional Arguments + * @return NewKeyInstance Created NewKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NewKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NewKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php new file mode 100644 index 0000000..f7d958d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateNewKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php new file mode 100644 index 0000000..e2788a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewKeyInstance \Twilio\Rest\Api\V2010\Account\NewKeyInstance + */ + public function buildInstance(array $payload): NewKeyInstance + { + return new NewKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php new file mode 100644 index 0000000..3c010e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php @@ -0,0 +1,90 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php new file mode 100644 index 0000000..d0cc276 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php @@ -0,0 +1,88 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys.json'; + } + + /** + * Create the NewSigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return NewSigningKeyInstance Created NewSigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NewSigningKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NewSigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php new file mode 100644 index 0000000..fb6ee57 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateNewSigningKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php new file mode 100644 index 0000000..bf7ad41 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewSigningKeyInstance \Twilio\Rest\Api\V2010\Account\NewSigningKeyInstance + */ + public function buildInstance(array $payload): NewSigningKeyInstance + { + return new NewSigningKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php new file mode 100644 index 0000000..de1430e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php @@ -0,0 +1,89 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Notifications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php new file mode 100644 index 0000000..a7bd766 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'log' => Values::array_get($payload, 'log'), + 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), + 'messageText' => Values::array_get($payload, 'message_text'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php new file mode 100644 index 0000000..c79a19f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Notifications.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NotificationInstance 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 NotificationPage Page of NotificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NotificationPage + { + $options = new Values($options); + + $params = Values::of([ + '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 NotificationPage Page of NotificationInstance + */ + public function getPage(string $targetUrl): NotificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NotificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NotificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. + */ + public function getContext( + string $sid + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php new file mode 100644 index 0000000..51a342f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php @@ -0,0 +1,132 @@ +=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return ReadNotificationOptions Options builder + */ + public static function read( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ): ReadNotificationOptions + { + return new ReadNotificationOptions( + $log, + $messageDateBefore, + $messageDate, + $messageDateAfter + ); + } + +} + + +class ReadNotificationOptions extends Options + { + /** + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + */ + public function __construct( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ) { + $this->options['log'] = $log; + $this->options['messageDateBefore'] = $messageDateBefore; + $this->options['messageDate'] = $messageDate; + $this->options['messageDateAfter'] = $messageDateAfter; + } + + /** + * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @return $this Fluent Builder + */ + public function setLog(int $log): self + { + $this->options['log'] = $log; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateBefore(string $messageDateBefore): self + { + $this->options['messageDateBefore'] = $messageDateBefore; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDate(string $messageDate): self + { + $this->options['messageDate'] = $messageDate; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateAfter(string $messageDateAfter): self + { + $this->options['messageDateAfter'] = $messageDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php new file mode 100644 index 0000000..7a5be6f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php new file mode 100644 index 0000000..252b3c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php @@ -0,0 +1,133 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the OutgoingCallerIdInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the OutgoingCallerIdInstance + * + * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OutgoingCallerIdInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new OutgoingCallerIdInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the OutgoingCallerIdInstance + * + * @param array|Options $options Optional Arguments + * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OutgoingCallerIdInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new OutgoingCallerIdInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.OutgoingCallerIdContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php new file mode 100644 index 0000000..66c39c0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['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 OutgoingCallerIdContext Context for this OutgoingCallerIdInstance + */ + protected function proxy(): OutgoingCallerIdContext + { + if (!$this->context) { + $this->context = new OutgoingCallerIdContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the OutgoingCallerIdInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the OutgoingCallerIdInstance + * + * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OutgoingCallerIdInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the OutgoingCallerIdInstance + * + * @param array|Options $options Optional Arguments + * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OutgoingCallerIdInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.OutgoingCallerIdInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php new file mode 100644 index 0000000..50b4eb4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php @@ -0,0 +1,177 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OutgoingCallerIdInstance 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 OutgoingCallerIdPage Page of OutgoingCallerIdInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OutgoingCallerIdPage + { + $options = new Values($options); + + $params = Values::of([ + '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 OutgoingCallerIdPage Page of OutgoingCallerIdInstance + */ + public function getPage(string $targetUrl): OutgoingCallerIdPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OutgoingCallerIdPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OutgoingCallerIdContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. + */ + public function getContext( + string $sid + + ): OutgoingCallerIdContext + { + return new OutgoingCallerIdContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.OutgoingCallerIdList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php new file mode 100644 index 0000000..51b2789 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php @@ -0,0 +1,150 @@ +options['phoneNumber'] = $phoneNumber; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The phone number of the OutgoingCallerId resources to read. + * + * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * The string that identifies the OutgoingCallerId resources to read. + * + * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadOutgoingCallerIdOptions ' . $options . ']'; + } +} + +class UpdateOutgoingCallerIdOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateOutgoingCallerIdOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php new file mode 100644 index 0000000..423c34c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OutgoingCallerIdInstance \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdInstance + */ + public function buildInstance(array $payload): OutgoingCallerIdInstance + { + return new OutgoingCallerIdInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.OutgoingCallerIdPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php new file mode 100644 index 0000000..58c0c6d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php @@ -0,0 +1,129 @@ +solution = [ + 'accountSid' => + $accountSid, + 'queueSid' => + $queueSid, + 'callSid' => + $callSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($queueSid) + .'/Members/' . \rawurlencode($callSid) + .'.json'; + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['queueSid'], + $this->solution['callSid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param string $url The absolute URL of the Queue resource. + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $url, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $url, + 'Method' => + $options['method'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php new file mode 100644 index 0000000..07566a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateEnqueued' => Deserialize::dateTime(Values::array_get($payload, 'date_enqueued')), + 'position' => Values::array_get($payload, 'position'), + 'uri' => Values::array_get($payload, 'uri'), + 'waitTime' => Values::array_get($payload, 'wait_time'), + 'queueSid' => Values::array_get($payload, 'queue_sid'), + ]; + + $this->solution = ['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 MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['queueSid'], + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param string $url The absolute URL of the Queue resource. + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $url, array $options = []): MemberInstance + { + + return $this->proxy()->update($url, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php new file mode 100644 index 0000000..d650e75 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'queueSid' => + $queueSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($queueSid) + .'/Members.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MemberPage Page of MemberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + + $params = Values::of([ + '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 MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. + */ + public function getContext( + string $callSid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['queueSid'], + $callSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MemberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php new file mode 100644 index 0000000..86517dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php @@ -0,0 +1,80 @@ +options['method'] = $method; + } + + /** + * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. + * + * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php new file mode 100644 index 0000000..9d28bbe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Api\V2010\Account\Queue\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MemberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php new file mode 100644 index 0000000..493f579 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php @@ -0,0 +1,194 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the QueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the QueueInstance + * + * @return QueueInstance Fetched QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueueInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the QueueInstance + * + * @param array|Options $options Optional Arguments + * @return QueueInstance Updated QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'MaxSize' => + $options['maxSize'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.QueueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php new file mode 100644 index 0000000..204e67d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'currentSize' => Values::array_get($payload, 'current_size'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uri' => Values::array_get($payload, 'uri'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'averageWaitTime' => Values::array_get($payload, 'average_wait_time'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'maxSize' => Values::array_get($payload, 'max_size'), + ]; + + $this->solution = ['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 QueueContext Context for this QueueInstance + */ + protected function proxy(): QueueContext + { + if (!$this->context) { + $this->context = new QueueContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the QueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the QueueInstance + * + * @return QueueInstance Fetched QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the QueueInstance + * + * @param array|Options $options Optional Arguments + * @return QueueInstance Updated QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueueInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.QueueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php new file mode 100644 index 0000000..cb16b66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php @@ -0,0 +1,201 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues.json'; + } + + /** + * Create the QueueInstance + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return QueueInstance Created QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): QueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'MaxSize' => + $options['maxSize'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 QueuePage Page of QueueInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): QueuePage + { + + $params = Values::of([ + '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 QueuePage Page of QueueInstance + */ + public function getPage(string $targetUrl): QueuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new QueuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a QueueContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete + */ + public function getContext( + string $sid + + ): QueueContext + { + return new QueueContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.QueueList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php new file mode 100644 index 0000000..f312325 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php @@ -0,0 +1,152 @@ +options['maxSize'] = $maxSize; + } + + /** + * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * @return $this Fluent Builder + */ + public function setMaxSize(int $maxSize): self + { + $this->options['maxSize'] = $maxSize; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateQueueOptions ' . $options . ']'; + } +} + + + + +class UpdateQueueOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + */ + public function __construct( + + string $friendlyName = Values::NONE, + int $maxSize = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['maxSize'] = $maxSize; + } + + /** + * A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * @return $this Fluent Builder + */ + public function setMaxSize(int $maxSize): self + { + $this->options['maxSize'] = $maxSize; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateQueueOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php new file mode 100644 index 0000000..8b78498 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return QueueInstance \Twilio\Rest\Api\V2010\Account\QueueInstance + */ + public function buildInstance(array $payload): QueueInstance + { + return new QueueInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.QueuePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php new file mode 100644 index 0000000..ce8a3db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php @@ -0,0 +1,115 @@ +solution = [ + 'accountSid' => + $accountSid, + 'referenceSid' => + $referenceSid, + 'addOnResultSid' => + $addOnResultSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($addOnResultSid) + .'/Payloads/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the PayloadInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PayloadInstance + * + * @return PayloadInstance Fetched PayloadInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PayloadInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PayloadInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['addOnResultSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PayloadContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php new file mode 100644 index 0000000..1dcfc8b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 PayloadContext Context for this PayloadInstance + */ + protected function proxy(): PayloadContext + { + if (!$this->context) { + $this->context = new PayloadContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['addOnResultSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PayloadInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PayloadInstance + * + * @return PayloadInstance Fetched PayloadInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PayloadInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PayloadInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php new file mode 100644 index 0000000..74bb260 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'referenceSid' => + $referenceSid, + + 'addOnResultSid' => + $addOnResultSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($addOnResultSid) + .'/Payloads.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PayloadPage Page of PayloadInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PayloadPage + { + + $params = Values::of([ + '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 PayloadPage Page of PayloadInstance + */ + public function getPage(string $targetUrl): PayloadPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PayloadPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PayloadContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. + */ + public function getContext( + string $sid + + ): PayloadContext + { + 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(): string + { + return '[Twilio.Api.V2010.PayloadList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php new file mode 100644 index 0000000..4c90e04 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PayloadInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadInstance + */ + public function buildInstance(array $payload): PayloadInstance + { + 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(): string + { + return '[Twilio.Api.V2010.PayloadPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php new file mode 100644 index 0000000..1fe90e4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php @@ -0,0 +1,169 @@ +solution = [ + 'accountSid' => + $accountSid, + 'referenceSid' => + $referenceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AddOnResultInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AddOnResultInstance + * + * @return AddOnResultInstance Fetched AddOnResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddOnResultInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AddOnResultInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the payloads + */ + protected function getPayloads(): PayloadList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddOnResultContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php new file mode 100644 index 0000000..8859f63 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php @@ -0,0 +1,161 @@ +properties = [ + '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 = ['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 AddOnResultContext Context for this AddOnResultInstance + */ + protected function proxy(): AddOnResultContext + { + if (!$this->context) { + $this->context = new AddOnResultContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddOnResultInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddOnResultInstance + * + * @return AddOnResultInstance Fetched AddOnResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddOnResultInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the payloads + */ + protected function getPayloads(): PayloadList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddOnResultInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php new file mode 100644 index 0000000..e37d91a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'referenceSid' => + $referenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AddOnResultPage Page of AddOnResultInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddOnResultPage + { + + $params = Values::of([ + '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 AddOnResultPage Page of AddOnResultInstance + */ + public function getPage(string $targetUrl): AddOnResultPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddOnResultPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddOnResultContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. + */ + public function getContext( + string $sid + + ): AddOnResultContext + { + return new AddOnResultContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddOnResultList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php new file mode 100644 index 0000000..0df6c14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddOnResultInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultInstance + */ + public function buildInstance(array $payload): AddOnResultInstance + { + return new AddOnResultInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddOnResultPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php new file mode 100644 index 0000000..447a8f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'recordingSid' => + $recordingSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($recordingSid) + .'/Transcriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php new file mode 100644 index 0000000..912d3b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['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 TranscriptionContext Context for this TranscriptionInstance + */ + protected function proxy(): TranscriptionContext + { + if (!$this->context) { + $this->context = new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php new file mode 100644 index 0000000..40998ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'recordingSid' => + $recordingSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($recordingSid) + .'/Transcriptions.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 TranscriptionPage Page of TranscriptionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TranscriptionPage + { + + $params = Values::of([ + '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 TranscriptionPage Page of TranscriptionInstance + */ + public function getPage(string $targetUrl): TranscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TranscriptionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. + */ + public function getContext( + string $sid + + ): TranscriptionContext + { + return new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php new file mode 100644 index 0000000..613fc83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionInstance + */ + public function buildInstance(array $payload): TranscriptionInstance + { + return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php new file mode 100644 index 0000000..8cde849 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php @@ -0,0 +1,192 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'IncludeSoftDeleted' => + Serialize::booleanToString($options['includeSoftDeleted']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the addOnResults + */ + protected function getAddOnResults(): AddOnResultList + { + if (!$this->_addOnResults) { + $this->_addOnResults = new AddOnResultList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_addOnResults; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + if (!$this->_transcriptions) { + $this->_transcriptions = new TranscriptionList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_transcriptions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php new file mode 100644 index 0000000..fe32b22 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php @@ -0,0 +1,189 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'uri' => Values::array_get($payload, 'uri'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'mediaUrl' => Values::array_get($payload, 'media_url'), + ]; + + $this->solution = ['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 RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RecordingInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Access the addOnResults + */ + protected function getAddOnResults(): AddOnResultList + { + return $this->proxy()->addOnResults; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + return $this->proxy()->transcriptions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php new file mode 100644 index 0000000..517b817 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php @@ -0,0 +1,186 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance 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 RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'CallSid' => + $options['callSid'], + 'ConferenceSid' => + $options['conferenceSid'], + 'IncludeSoftDeleted' => + Serialize::booleanToString($options['includeSoftDeleted']), + '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 RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php new file mode 100644 index 0000000..7f7d7ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php @@ -0,0 +1,220 @@ +=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $callSid = Values::NONE, + string $conferenceSid = Values::NONE, + bool $includeSoftDeleted = Values::BOOL_NONE + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter, + $callSid, + $conferenceSid, + $includeSoftDeleted + ); + } + +} + + +class FetchRecordingOptions extends Options + { + /** + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + */ + public function __construct( + + bool $includeSoftDeleted = Values::BOOL_NONE + + ) { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + } + + /** + * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return $this Fluent Builder + */ + public function setIncludeSoftDeleted(bool $includeSoftDeleted): self + { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.FetchRecordingOptions ' . $options . ']'; + } +} + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $callSid = Values::NONE, + string $conferenceSid = Values::NONE, + bool $includeSoftDeleted = Values::BOOL_NONE + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['callSid'] = $callSid; + $this->options['conferenceSid'] = $conferenceSid; + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @return $this Fluent Builder + */ + public function setCallSid(string $callSid): self + { + $this->options['callSid'] = $callSid; + return $this; + } + + /** + * The Conference SID that identifies the conference associated with the recording to read. + * + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @return $this Fluent Builder + */ + public function setConferenceSid(string $conferenceSid): self + { + $this->options['conferenceSid'] = $conferenceSid; + return $this; + } + + /** + * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return $this Fluent Builder + */ + public function setIncludeSoftDeleted(bool $includeSoftDeleted): self + { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php new file mode 100644 index 0000000..8433b83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php new file mode 100644 index 0000000..d07085d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php @@ -0,0 +1,129 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SMS/ShortCodes/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApiVersion' => + $options['apiVersion'], + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php new file mode 100644 index 0000000..6977c8a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php new file mode 100644 index 0000000..a230dc4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php @@ -0,0 +1,177 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SMS/ShortCodes.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ShortCodePage Page of ShortCodeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + $options = new Values($options); + + $params = Values::of([ + '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 ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ShortCodeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php new file mode 100644 index 0000000..ef5eb45 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php @@ -0,0 +1,238 @@ +options['friendlyName'] = $friendlyName; + $this->options['shortCode'] = $shortCode; + } + + /** + * The string that identifies the ShortCode resources to read. + * + * @param string $friendlyName The string that identifies the ShortCode resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setShortCode(string $shortCode): self + { + $this->options['shortCode'] = $shortCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadShortCodeOptions ' . $options . ']'; + } +} + +class UpdateShortCodeOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. + * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apiVersion = Values::NONE, + string $smsUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['apiVersion'] = $apiVersion; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + } + + /** + * A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when receiving an incoming SMS message to this short code. + * + * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateShortCodeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php new file mode 100644 index 0000000..a725025 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Api\V2010\Account\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ShortCodePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php new file mode 100644 index 0000000..e28c17d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php @@ -0,0 +1,133 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the SigningKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SigningKeyInstance + * + * @return SigningKeyInstance Fetched SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SigningKeyInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return SigningKeyInstance Updated SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SigningKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SigningKeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php new file mode 100644 index 0000000..e403dc5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 SigningKeyContext Context for this SigningKeyInstance + */ + protected function proxy(): SigningKeyContext + { + if (!$this->context) { + $this->context = new SigningKeyContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SigningKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SigningKeyInstance + * + * @return SigningKeyInstance Fetched SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SigningKeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return SigningKeyInstance Updated SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SigningKeyInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SigningKeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php new file mode 100644 index 0000000..fba9c02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SigningKeyPage Page of SigningKeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SigningKeyPage + { + + $params = Values::of([ + '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 SigningKeyPage Page of SigningKeyInstance + */ + public function getPage(string $targetUrl): SigningKeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SigningKeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SigningKeyContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SigningKeyContext + { + return new SigningKeyContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SigningKeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php new file mode 100644 index 0000000..02e0d65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php @@ -0,0 +1,82 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateSigningKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php new file mode 100644 index 0000000..a3f767e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SigningKeyInstance \Twilio\Rest\Api\V2010\Account\SigningKeyInstance + */ + public function buildInstance(array $payload): SigningKeyInstance + { + return new SigningKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SigningKeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php new file mode 100644 index 0000000..0f758e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php @@ -0,0 +1,140 @@ +solution = [ + 'accountSid' => + $accountSid, + 'credentialListSid' => + $credentialListSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) + .'/Credentials/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Password' => + $options['password'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php new file mode 100644 index 0000000..330f672 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php @@ -0,0 +1,158 @@ +properties = [ + '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 = ['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 CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php new file mode 100644 index 0000000..8013bcf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php @@ -0,0 +1,206 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'credentialListSid' => + $credentialListSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) + .'/Credentials.json'; + } + + /** + * Create the CredentialInstance + * + * @param string $username The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio's challenge of the initial INVITE. It can be up to 32 characters long. + * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $username, string $password): CredentialInstance + { + + $data = Values::of([ + 'Username' => + $username, + 'Password' => + $password, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The unique id that identifies the resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php new file mode 100644 index 0000000..6e48aea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php @@ -0,0 +1,84 @@ +options['password'] = $password; + } + + /** + * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * + * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * @return $this Fluent Builder + */ + public function setPassword(string $password): self + { + $this->options['password'] = $password; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php new file mode 100644 index 0000000..f5a3d50 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php new file mode 100644 index 0000000..58f0ced --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php @@ -0,0 +1,189 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. + * @return CredentialListInstance Updated CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): CredentialListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the credentials + */ + protected function getCredentials(): CredentialList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php new file mode 100644 index 0000000..6b537b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 CredentialListContext Context for this CredentialListInstance + */ + protected function proxy(): CredentialListContext + { + if (!$this->context) { + $this->context = new CredentialListContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. + * @return CredentialListInstance Updated CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): CredentialListInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the credentials + */ + protected function getCredentials(): CredentialList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php new file mode 100644 index 0000000..a8c1f80 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php @@ -0,0 +1,196 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists.json'; + } + + /** + * Create the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text that describes the CredentialList, up to 64 characters long. + * @return CredentialListInstance Created CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): CredentialListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialListPage Page of CredentialListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListPage + { + + $params = Values::of([ + '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 CredentialListPage Page of CredentialListInstance + */ + public function getPage(string $targetUrl): CredentialListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListContext + * + * @param string $sid The credential list Sid that uniquely identifies this resource + */ + public function getContext( + string $sid + + ): CredentialListContext + { + return new CredentialListContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php new file mode 100644 index 0000000..979c527 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialListInstance + */ + public function buildInstance(array $payload): CredentialListInstance + { + return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php new file mode 100644 index 0000000..09a2207 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthCallsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AuthCallsCredentialListMappingInstance + * + * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsCredentialListMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthCallsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php new file mode 100644 index 0000000..0754d8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['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 AuthCallsCredentialListMappingContext Context for this AuthCallsCredentialListMappingInstance + */ + protected function proxy(): AuthCallsCredentialListMappingContext + { + if (!$this->context) { + $this->context = new AuthCallsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthCallsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthCallsCredentialListMappingInstance + * + * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsCredentialListMappingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php new file mode 100644 index 0000000..08147ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/CredentialListMappings.json'; + } + + /** + * Create the AuthCallsCredentialListMappingInstance + * + * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. + * @return AuthCallsCredentialListMappingInstance Created AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): AuthCallsCredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AuthCallsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthCallsCredentialListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthCallsCredentialListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthCallsCredentialListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthCallsCredentialListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthCallsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance + */ + public function getPage(string $targetUrl): AuthCallsCredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthCallsCredentialListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthCallsCredentialListMappingContext + { + return new AuthCallsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php new file mode 100644 index 0000000..2e23c5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthCallsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingInstance + */ + public function buildInstance(array $payload): AuthCallsCredentialListMappingInstance + { + return new AuthCallsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php new file mode 100644 index 0000000..fb82e6b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthCallsIpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AuthCallsIpAccessControlListMappingInstance + * + * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsIpAccessControlListMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthCallsIpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php new file mode 100644 index 0000000..13a6d5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['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 AuthCallsIpAccessControlListMappingContext Context for this AuthCallsIpAccessControlListMappingInstance + */ + protected function proxy(): AuthCallsIpAccessControlListMappingContext + { + if (!$this->context) { + $this->context = new AuthCallsIpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthCallsIpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthCallsIpAccessControlListMappingInstance + * + * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsIpAccessControlListMappingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php new file mode 100644 index 0000000..445d9d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/IpAccessControlListMappings.json'; + } + + /** + * Create the AuthCallsIpAccessControlListMappingInstance + * + * @param string $ipAccessControlListSid The SID of the IpAccessControlList resource to map to the SIP domain. + * @return AuthCallsIpAccessControlListMappingInstance Created AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): AuthCallsIpAccessControlListMappingInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AuthCallsIpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthCallsIpAccessControlListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthCallsIpAccessControlListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthCallsIpAccessControlListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthCallsIpAccessControlListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthCallsIpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance + */ + public function getPage(string $targetUrl): AuthCallsIpAccessControlListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthCallsIpAccessControlListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthCallsIpAccessControlListMappingContext + { + return new AuthCallsIpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php new file mode 100644 index 0000000..c8a64c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthCallsIpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingInstance + */ + public function buildInstance(array $payload): AuthCallsIpAccessControlListMappingInstance + { + return new AuthCallsIpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php new file mode 100644 index 0000000..f51e544 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php new file mode 100644 index 0000000..29b3713 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php @@ -0,0 +1,137 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): AuthCallsIpAccessControlListMappingList + { + if (!$this->_ipAccessControlListMappings) { + $this->_ipAccessControlListMappings = new AuthCallsIpAccessControlListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_ipAccessControlListMappings; + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): AuthCallsCredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new AuthCallsCredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_credentialListMappings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php new file mode 100644 index 0000000..e2f779e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypeCallsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsInstance + */ + public function buildInstance(array $payload): AuthTypeCallsInstance + { + return new AuthTypeCallsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php new file mode 100644 index 0000000..b466d71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthRegistrationsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AuthRegistrationsCredentialListMappingInstance + * + * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthRegistrationsCredentialListMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthRegistrationsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php new file mode 100644 index 0000000..7ed498c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['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 AuthRegistrationsCredentialListMappingContext Context for this AuthRegistrationsCredentialListMappingInstance + */ + protected function proxy(): AuthRegistrationsCredentialListMappingContext + { + if (!$this->context) { + $this->context = new AuthRegistrationsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthRegistrationsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthRegistrationsCredentialListMappingInstance + * + * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthRegistrationsCredentialListMappingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php new file mode 100644 index 0000000..ccf761b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Registrations/CredentialListMappings.json'; + } + + /** + * Create the AuthRegistrationsCredentialListMappingInstance + * + * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. + * @return AuthRegistrationsCredentialListMappingInstance Created AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): AuthRegistrationsCredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AuthRegistrationsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthRegistrationsCredentialListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthRegistrationsCredentialListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthRegistrationsCredentialListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthRegistrationsCredentialListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthRegistrationsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance + */ + public function getPage(string $targetUrl): AuthRegistrationsCredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthRegistrationsCredentialListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthRegistrationsCredentialListMappingContext + { + return new AuthRegistrationsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php new file mode 100644 index 0000000..26cda83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthRegistrationsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingInstance + */ + public function buildInstance(array $payload): AuthRegistrationsCredentialListMappingInstance + { + return new AuthRegistrationsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php new file mode 100644 index 0000000..19b18c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php new file mode 100644 index 0000000..9371bd6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php @@ -0,0 +1,118 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): AuthRegistrationsCredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_credentialListMappings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php new file mode 100644 index 0000000..6d27932 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypeRegistrationsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsInstance + */ + public function buildInstance(array $payload): AuthTypeRegistrationsInstance + { + return new AuthTypeRegistrationsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php new file mode 100644 index 0000000..92229bc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypesInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php new file mode 100644 index 0000000..f3ec6a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php @@ -0,0 +1,135 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the calls + */ + protected function getCalls(): AuthTypeCallsList + { + if (!$this->_calls) { + $this->_calls = new AuthTypeCallsList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_calls; + } + + /** + * Access the registrations + */ + protected function getRegistrations(): AuthTypeRegistrationsList + { + if (!$this->_registrations) { + $this->_registrations = new AuthTypeRegistrationsList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_registrations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.AuthTypesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php new file mode 100644 index 0000000..66f4c1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypesInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesInstance + */ + public function buildInstance(array $payload): AuthTypesInstance + { + return new AuthTypesInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php new file mode 100644 index 0000000..e0760a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialListMappingInstance + * + * @return CredentialListMappingInstance Fetched CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php new file mode 100644 index 0000000..dfde30e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php @@ -0,0 +1,144 @@ +properties = [ + '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')), + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 CredentialListMappingContext Context for this CredentialListMappingInstance + */ + protected function proxy(): CredentialListMappingContext + { + if (!$this->context) { + $this->context = new CredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListMappingInstance + * + * @return CredentialListMappingInstance Fetched CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListMappingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php new file mode 100644 index 0000000..806ec99 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/CredentialListMappings.json'; + } + + /** + * Create the CredentialListMappingInstance + * + * @param string $credentialListSid A 34 character string that uniquely identifies the CredentialList resource to map to the SIP domain. + * @return CredentialListMappingInstance Created CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): CredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialListMappingPage Page of CredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListMappingPage + { + + $params = Values::of([ + '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 CredentialListMappingPage Page of CredentialListMappingInstance + */ + public function getPage(string $targetUrl): CredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListMappingContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): CredentialListMappingContext + { + return new CredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php new file mode 100644 index 0000000..ea7c854 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingInstance + */ + public function buildInstance(array $payload): CredentialListMappingInstance + { + return new CredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php new file mode 100644 index 0000000..47ed1e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/IpAccessControlListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IpAccessControlListMappingInstance + * + * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php new file mode 100644 index 0000000..e787cf5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php @@ -0,0 +1,144 @@ +properties = [ + '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')), + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 IpAccessControlListMappingContext Context for this IpAccessControlListMappingInstance + */ + protected function proxy(): IpAccessControlListMappingContext + { + if (!$this->context) { + $this->context = new IpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListMappingInstance + * + * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListMappingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php new file mode 100644 index 0000000..7411f7c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php @@ -0,0 +1,203 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/IpAccessControlListMappings.json'; + } + + /** + * Create the IpAccessControlListMappingInstance + * + * @param string $ipAccessControlListSid The unique id of the IP access control list to map to the SIP domain. + * @return IpAccessControlListMappingInstance Created IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): IpAccessControlListMappingInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListMappingPage + { + + $params = Values::of([ + '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 IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance + */ + public function getPage(string $targetUrl): IpAccessControlListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListMappingContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListMappingContext + { + return new IpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php new file mode 100644 index 0000000..cb760e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingInstance + */ + public function buildInstance(array $payload): IpAccessControlListMappingInstance + { + return new IpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php new file mode 100644 index 0000000..d49d2bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php @@ -0,0 +1,256 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the DomainInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DomainInstance + * + * @return DomainInstance Fetched DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DomainInstance + * + * @param array|Options $options Optional Arguments + * @return DomainInstance Updated DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceStatusCallbackMethod' => + $options['voiceStatusCallbackMethod'], + 'VoiceStatusCallbackUrl' => + $options['voiceStatusCallbackUrl'], + 'VoiceUrl' => + $options['voiceUrl'], + 'SipRegistration' => + Serialize::booleanToString($options['sipRegistration']), + 'DomainName' => + $options['domainName'], + 'EmergencyCallingEnabled' => + Serialize::booleanToString($options['emergencyCallingEnabled']), + 'Secure' => + Serialize::booleanToString($options['secure']), + 'ByocTrunkSid' => + $options['byocTrunkSid'], + 'EmergencyCallerSid' => + $options['emergencyCallerSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): CredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new CredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_credentialListMappings; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): IpAccessControlListMappingList + { + if (!$this->_ipAccessControlListMappings) { + $this->_ipAccessControlListMappings = new IpAccessControlListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_ipAccessControlListMappings; + } + + /** + * Access the auth + */ + protected function getAuth(): AuthTypesList + { + if (!$this->_auth) { + $this->_auth = new AuthTypesList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_auth; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.DomainContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php new file mode 100644 index 0000000..dbfb6ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php @@ -0,0 +1,215 @@ +properties = [ + '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'), + 'emergencyCallingEnabled' => Values::array_get($payload, 'emergency_calling_enabled'), + 'secure' => Values::array_get($payload, 'secure'), + 'byocTrunkSid' => Values::array_get($payload, 'byoc_trunk_sid'), + 'emergencyCallerSid' => Values::array_get($payload, 'emergency_caller_sid'), + ]; + + $this->solution = ['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 DomainContext Context for this DomainInstance + */ + protected function proxy(): DomainContext + { + if (!$this->context) { + $this->context = new DomainContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DomainInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DomainInstance + * + * @return DomainInstance Fetched DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainInstance + * + * @param array|Options $options Optional Arguments + * @return DomainInstance Updated DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): CredentialListMappingList + { + return $this->proxy()->credentialListMappings; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): IpAccessControlListMappingList + { + return $this->proxy()->ipAccessControlListMappings; + } + + /** + * Access the auth + */ + protected function getAuth(): AuthTypesList + { + return $this->proxy()->auth; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.DomainInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php new file mode 100644 index 0000000..309c671 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php @@ -0,0 +1,224 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains.json'; + } + + /** + * Create the DomainInstance + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @param array|Options $options Optional Arguments + * @return DomainInstance Created DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $domainName, array $options = []): DomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DomainName' => + $domainName, + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceStatusCallbackUrl' => + $options['voiceStatusCallbackUrl'], + 'VoiceStatusCallbackMethod' => + $options['voiceStatusCallbackMethod'], + 'SipRegistration' => + Serialize::booleanToString($options['sipRegistration']), + 'EmergencyCallingEnabled' => + Serialize::booleanToString($options['emergencyCallingEnabled']), + 'Secure' => + Serialize::booleanToString($options['secure']), + 'ByocTrunkSid' => + $options['byocTrunkSid'], + 'EmergencyCallerSid' => + $options['emergencyCallerSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DomainPage Page of DomainInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DomainPage + { + + $params = Values::of([ + '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 DomainPage Page of DomainInstance + */ + public function getPage(string $targetUrl): DomainPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DomainPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DomainContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. + */ + public function getContext( + string $sid + + ): DomainContext + { + return new DomainContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DomainList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php new file mode 100644 index 0000000..5bbfc2c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php @@ -0,0 +1,548 @@ +options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + $this->options['sipRegistration'] = $sipRegistration; + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + $this->options['secure'] = $secure; + $this->options['byocTrunkSid'] = $byocTrunkSid; + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + } + + /** + * A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should when the domain receives a call. + * + * @param string $voiceUrl The URL we should when the domain receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self + { + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self + { + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + return $this; + } + + /** + * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @return $this Fluent Builder + */ + public function setSipRegistration(bool $sipRegistration): self + { + $this->options['sipRegistration'] = $sipRegistration; + return $this; + } + + /** + * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @return $this Fluent Builder + */ + public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self + { + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + return $this; + } + + /** + * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @return $this Fluent Builder + */ + public function setByocTrunkSid(string $byocTrunkSid): self + { + $this->options['byocTrunkSid'] = $byocTrunkSid; + return $this; + } + + /** + * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * @return $this Fluent Builder + */ + public function setEmergencyCallerSid(string $emergencyCallerSid): self + { + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateDomainOptions ' . $options . ']'; + } +} + + + + +class UpdateDomainOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @param string $voiceUrl The URL we should call when the domain receives a call. + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceStatusCallbackMethod = Values::NONE, + string $voiceStatusCallbackUrl = Values::NONE, + string $voiceUrl = Values::NONE, + bool $sipRegistration = Values::BOOL_NONE, + string $domainName = Values::NONE, + bool $emergencyCallingEnabled = Values::BOOL_NONE, + bool $secure = Values::BOOL_NONE, + string $byocTrunkSid = Values::NONE, + string $emergencyCallerSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['sipRegistration'] = $sipRegistration; + $this->options['domainName'] = $domainName; + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + $this->options['secure'] = $secure; + $this->options['byocTrunkSid'] = $byocTrunkSid; + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + } + + /** + * A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url` + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self + { + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self + { + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + return $this; + } + + /** + * The URL we should call when the domain receives a call. + * + * @param string $voiceUrl The URL we should call when the domain receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @return $this Fluent Builder + */ + public function setSipRegistration(bool $sipRegistration): self + { + $this->options['sipRegistration'] = $sipRegistration; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @return $this Fluent Builder + */ + public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self + { + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + return $this; + } + + /** + * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @return $this Fluent Builder + */ + public function setByocTrunkSid(string $byocTrunkSid): self + { + $this->options['byocTrunkSid'] = $byocTrunkSid; + return $this; + } + + /** + * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * @return $this Fluent Builder + */ + public function setEmergencyCallerSid(string $emergencyCallerSid): self + { + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateDomainOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php new file mode 100644 index 0000000..b9f9b23 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainInstance \Twilio\Rest\Api\V2010\Account\Sip\DomainInstance + */ + public function buildInstance(array $payload): DomainInstance + { + return new DomainInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DomainPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php new file mode 100644 index 0000000..c8cc742 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php @@ -0,0 +1,144 @@ +solution = [ + 'accountSid' => + $accountSid, + 'ipAccessControlListSid' => + $ipAccessControlListSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) + .'/IpAddresses/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IpAddressInstance + * + * @return IpAddressInstance Fetched IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAddressInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IpAddressInstance + * + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Updated IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpAddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IpAddress' => + $options['ipAddress'], + 'FriendlyName' => + $options['friendlyName'], + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAddressContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php new file mode 100644 index 0000000..8e009b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), + 'ipAccessControlListSid' => Values::array_get($payload, 'ip_access_control_list_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['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 IpAddressContext Context for this IpAddressInstance + */ + protected function proxy(): IpAddressContext + { + if (!$this->context) { + $this->context = new IpAddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAddressInstance + * + * @return IpAddressInstance Fetched IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAddressInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpAddressInstance + * + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Updated IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpAddressInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAddressInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php new file mode 100644 index 0000000..e942dbf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php @@ -0,0 +1,212 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'ipAccessControlListSid' => + $ipAccessControlListSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) + .'/IpAddresses.json'; + } + + /** + * Create the IpAddressInstance + * + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Created IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $ipAddress, array $options = []): IpAddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'IpAddress' => + $ipAddress, + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 IpAddressPage Page of IpAddressInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAddressPage + { + + $params = Values::of([ + '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 IpAddressPage Page of IpAddressInstance + */ + public function getPage(string $targetUrl): IpAddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAddressPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAddressContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAddressContext + { + return new IpAddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAddressList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php new file mode 100644 index 0000000..4976ac3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php @@ -0,0 +1,170 @@ +options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateIpAddressOptions ' . $options . ']'; + } +} + + + + +class UpdateIpAddressOptions extends Options + { + /** + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + */ + public function __construct( + + string $ipAddress = Values::NONE, + string $friendlyName = Values::NONE, + int $cidrPrefixLength = Values::INT_NONE + + ) { + $this->options['ipAddress'] = $ipAddress; + $this->options['friendlyName'] = $friendlyName; + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @return $this Fluent Builder + */ + public function setIpAddress(string $ipAddress): self + { + $this->options['ipAddress'] = $ipAddress; + return $this; + } + + /** + * A human readable descriptive text for this resource, up to 255 characters long. + * + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateIpAddressOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php new file mode 100644 index 0000000..967fbef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAddressInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressInstance + */ + public function buildInstance(array $payload): IpAddressInstance + { + return new IpAddressInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAddressPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php new file mode 100644 index 0000000..51939f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php @@ -0,0 +1,189 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text, up to 255 characters long. + * @return IpAccessControlListInstance Updated IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): IpAccessControlListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the ipAddresses + */ + protected function getIpAddresses(): IpAddressList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php new file mode 100644 index 0000000..adf7595 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 IpAccessControlListContext Context for this IpAccessControlListInstance + */ + protected function proxy(): IpAccessControlListContext + { + if (!$this->context) { + $this->context = new IpAccessControlListContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text, up to 255 characters long. + * @return IpAccessControlListInstance Updated IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): IpAccessControlListInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the ipAddresses + */ + protected function getIpAddresses(): IpAddressList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php new file mode 100644 index 0000000..055bf03 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php @@ -0,0 +1,195 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists.json'; + } + + /** + * Create the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text that describes the IpAccessControlList, up to 255 characters long. + * @return IpAccessControlListInstance Created IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): IpAccessControlListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListPage + { + + $params = Values::of([ + '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 IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function getPage(string $targetUrl): IpAccessControlListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListContext + { + return new IpAccessControlListContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php new file mode 100644 index 0000000..179a8f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListInstance + */ + public function buildInstance(array $payload): IpAccessControlListInstance + { + return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php new file mode 100644 index 0000000..df74a4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php @@ -0,0 +1,72 @@ +solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SipInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php new file mode 100644 index 0000000..34f5420 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php @@ -0,0 +1,148 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + } + + /** + * Access the domains + */ + protected function getDomains(): DomainList + { + if (!$this->_domains) { + $this->_domains = new DomainList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_domains; + } + + /** + * Access the credentialLists + */ + protected function getCredentialLists(): CredentialListList + { + if (!$this->_credentialLists) { + $this->_credentialLists = new CredentialListList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_credentialLists; + } + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + if (!$this->_ipAccessControlLists) { + $this->_ipAccessControlLists = new IpAccessControlListList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_ipAccessControlLists; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.SipList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php new file mode 100644 index 0000000..46d0a2f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SipInstance \Twilio\Rest\Api\V2010\Account\SipInstance + */ + public function buildInstance(array $payload): SipInstance + { + return new SipInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SipPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php new file mode 100644 index 0000000..3f3e405 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php @@ -0,0 +1,94 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php new file mode 100644 index 0000000..c7d317c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php @@ -0,0 +1,88 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Tokens.json'; + } + + /** + * Create the TokenInstance + * + * @param array|Options $options Optional Arguments + * @return TokenInstance Created TokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TokenInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php new file mode 100644 index 0000000..721fcc6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php @@ -0,0 +1,76 @@ +options['ttl'] = $ttl; + } + + /** + * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). + * + * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTokenOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php new file mode 100644 index 0000000..de82289 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TokenInstance \Twilio\Rest\Api\V2010\Account\TokenInstance + */ + public function buildInstance(array $payload): TokenInstance + { + return new TokenInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php new file mode 100644 index 0000000..6218784 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php @@ -0,0 +1,103 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Transcriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php new file mode 100644 index 0000000..8216a8e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 TranscriptionContext Context for this TranscriptionInstance + */ + protected function proxy(): TranscriptionContext + { + if (!$this->context) { + $this->context = new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php new file mode 100644 index 0000000..03dd6c0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Transcriptions.json'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 TranscriptionPage Page of TranscriptionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TranscriptionPage + { + + $params = Values::of([ + '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 TranscriptionPage Page of TranscriptionInstance + */ + public function getPage(string $targetUrl): TranscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TranscriptionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. + */ + public function getContext( + string $sid + + ): TranscriptionContext + { + return new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php new file mode 100644 index 0000000..230ac30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\TranscriptionInstance + */ + public function buildInstance(array $payload): TranscriptionInstance + { + return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php new file mode 100644 index 0000000..d42ce6a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AllTimeInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php new file mode 100644 index 0000000..002d9d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/AllTime.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AllTimeInstance 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 AllTimePage Page of AllTimeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AllTimePage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AllTimePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AllTimeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AllTimePage Page of AllTimeInstance + */ + public function getPage(string $targetUrl): AllTimePage + { + $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(): string + { + return '[Twilio.Api.V2010.AllTimeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php new file mode 100644 index 0000000..db8d2d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAllTimeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php new file mode 100644 index 0000000..2db6128 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AllTimeInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeInstance + */ + public function buildInstance(array $payload): AllTimeInstance + { + return new AllTimeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AllTimePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php new file mode 100644 index 0000000..dfce917 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DailyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php new file mode 100644 index 0000000..b86347d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Daily.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DailyInstance 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 DailyPage Page of DailyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DailyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DailyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DailyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DailyPage Page of DailyInstance + */ + public function getPage(string $targetUrl): DailyPage + { + $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(): string + { + return '[Twilio.Api.V2010.DailyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php new file mode 100644 index 0000000..75a7cc7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadDailyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php new file mode 100644 index 0000000..35ce1ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DailyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyInstance + */ + public function buildInstance(array $payload): DailyInstance + { + return new DailyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DailyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php new file mode 100644 index 0000000..2ae1d01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LastMonthInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php new file mode 100644 index 0000000..af429f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/LastMonth.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LastMonthInstance 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 LastMonthPage Page of LastMonthInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LastMonthPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LastMonthPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LastMonthInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LastMonthPage Page of LastMonthInstance + */ + public function getPage(string $targetUrl): LastMonthPage + { + $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(): string + { + return '[Twilio.Api.V2010.LastMonthList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php new file mode 100644 index 0000000..cd67a32 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLastMonthOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php new file mode 100644 index 0000000..ade76ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LastMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthInstance + */ + public function buildInstance(array $payload): LastMonthInstance + { + return new LastMonthInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LastMonthPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php new file mode 100644 index 0000000..dbfd60c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MonthlyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php new file mode 100644 index 0000000..c6f35db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Monthly.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MonthlyInstance 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 MonthlyPage Page of MonthlyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MonthlyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MonthlyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MonthlyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MonthlyPage Page of MonthlyInstance + */ + public function getPage(string $targetUrl): MonthlyPage + { + $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(): string + { + return '[Twilio.Api.V2010.MonthlyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php new file mode 100644 index 0000000..b9a9dad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMonthlyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php new file mode 100644 index 0000000..1ce1ee0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MonthlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyInstance + */ + public function buildInstance(array $payload): MonthlyInstance + { + return new MonthlyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MonthlyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php new file mode 100644 index 0000000..d61d1ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ThisMonthInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php new file mode 100644 index 0000000..aa71ac6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/ThisMonth.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ThisMonthInstance 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 ThisMonthPage Page of ThisMonthInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ThisMonthPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ThisMonthPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ThisMonthInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ThisMonthPage Page of ThisMonthInstance + */ + public function getPage(string $targetUrl): ThisMonthPage + { + $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(): string + { + return '[Twilio.Api.V2010.ThisMonthList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php new file mode 100644 index 0000000..d3d4d1d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadThisMonthOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php new file mode 100644 index 0000000..a99d4f4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ThisMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthInstance + */ + public function buildInstance(array $payload): ThisMonthInstance + { + return new ThisMonthInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ThisMonthPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php new file mode 100644 index 0000000..92d9650 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TodayInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php new file mode 100644 index 0000000..9c3e91b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Today.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TodayInstance 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 TodayPage Page of TodayInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TodayPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TodayPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TodayInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TodayPage Page of TodayInstance + */ + public function getPage(string $targetUrl): TodayPage + { + $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(): string + { + return '[Twilio.Api.V2010.TodayList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php new file mode 100644 index 0000000..1d877d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTodayOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php new file mode 100644 index 0000000..7a90470 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TodayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayInstance + */ + public function buildInstance(array $payload): TodayInstance + { + return new TodayInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TodayPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php new file mode 100644 index 0000000..07ca8c1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YearlyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php new file mode 100644 index 0000000..74aad36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Yearly.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of YearlyInstance 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 YearlyPage Page of YearlyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): YearlyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new YearlyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of YearlyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return YearlyPage Page of YearlyInstance + */ + public function getPage(string $targetUrl): YearlyPage + { + $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(): string + { + return '[Twilio.Api.V2010.YearlyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php new file mode 100644 index 0000000..1a807c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadYearlyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php new file mode 100644 index 0000000..f5e0bb6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return YearlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyInstance + */ + public function buildInstance(array $payload): YearlyInstance + { + return new YearlyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YearlyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php new file mode 100644 index 0000000..ed11d54 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YesterdayInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php new file mode 100644 index 0000000..1855749 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Yesterday.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of YesterdayInstance 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 YesterdayPage Page of YesterdayInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): YesterdayPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new YesterdayPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of YesterdayInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return YesterdayPage Page of YesterdayInstance + */ + public function getPage(string $targetUrl): YesterdayPage + { + $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(): string + { + return '[Twilio.Api.V2010.YesterdayList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php new file mode 100644 index 0000000..766b99a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadYesterdayOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php new file mode 100644 index 0000000..39f8152 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return YesterdayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayInstance + */ + public function buildInstance(array $payload): YesterdayInstance + { + return new YesterdayInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YesterdayPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php new file mode 100644 index 0000000..9549b87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php new file mode 100644 index 0000000..f377f74 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php @@ -0,0 +1,341 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records.json'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordInstance 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 RecordPage Page of RecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordPage Page of RecordInstance + */ + public function getPage(string $targetUrl): RecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordPage($this->version, $response, $this->solution); + } + + + /** + * Access the lastMonth + */ + protected function getLastMonth(): LastMonthList + { + if (!$this->_lastMonth) { + $this->_lastMonth = new LastMonthList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_lastMonth; + } + + /** + * Access the today + */ + protected function getToday(): TodayList + { + if (!$this->_today) { + $this->_today = new TodayList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_today; + } + + /** + * Access the yearly + */ + protected function getYearly(): YearlyList + { + if (!$this->_yearly) { + $this->_yearly = new YearlyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_yearly; + } + + /** + * Access the thisMonth + */ + protected function getThisMonth(): ThisMonthList + { + if (!$this->_thisMonth) { + $this->_thisMonth = new ThisMonthList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_thisMonth; + } + + /** + * Access the daily + */ + protected function getDaily(): DailyList + { + if (!$this->_daily) { + $this->_daily = new DailyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_daily; + } + + /** + * Access the allTime + */ + protected function getAllTime(): AllTimeList + { + if (!$this->_allTime) { + $this->_allTime = new AllTimeList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_allTime; + } + + /** + * Access the yesterday + */ + protected function getYesterday(): YesterdayList + { + if (!$this->_yesterday) { + $this->_yesterday = new YesterdayList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_yesterday; + } + + /** + * Access the monthly + */ + protected function getMonthly(): MonthlyList + { + if (!$this->_monthly) { + $this->_monthly = new MonthlyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_monthly; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.RecordList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php new file mode 100644 index 0000000..67bbaeb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php new file mode 100644 index 0000000..4a9b210 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordInstance \Twilio\Rest\Api\V2010\Account\Usage\RecordInstance + */ + public function buildInstance(array $payload): RecordInstance + { + return new RecordInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php new file mode 100644 index 0000000..24048f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php @@ -0,0 +1,137 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Triggers/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TriggerInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TriggerInstance + * + * @return TriggerInstance Fetched TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TriggerInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TriggerInstance + * + * @param array|Options $options Optional Arguments + * @return TriggerInstance Updated TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TriggerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TriggerContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php new file mode 100644 index 0000000..b36ba5c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php @@ -0,0 +1,174 @@ +properties = [ + '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 = ['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 TriggerContext Context for this TriggerInstance + */ + protected function proxy(): TriggerContext + { + if (!$this->context) { + $this->context = new TriggerContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TriggerInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TriggerInstance + * + * @return TriggerInstance Fetched TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TriggerInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TriggerInstance + * + * @param array|Options $options Optional Arguments + * @return TriggerInstance Updated TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TriggerInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TriggerInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php new file mode 100644 index 0000000..3bd14fe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php @@ -0,0 +1,223 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Triggers.json'; + } + + /** + * Create the TriggerInstance + * + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @param string $triggerValue The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. + * @param string $usageCategory + * @param array|Options $options Optional Arguments + * @return TriggerInstance Created TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $callbackUrl, string $triggerValue, string $usageCategory, array $options = []): TriggerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackUrl' => + $callbackUrl, + 'TriggerValue' => + $triggerValue, + 'UsageCategory' => + $usageCategory, + 'CallbackMethod' => + $options['callbackMethod'], + 'FriendlyName' => + $options['friendlyName'], + 'Recurring' => + $options['recurring'], + 'TriggerBy' => + $options['triggerBy'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TriggerInstance 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 TriggerPage Page of TriggerInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TriggerPage + { + $options = new Values($options); + + $params = Values::of([ + '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 TriggerPage Page of TriggerInstance + */ + public function getPage(string $targetUrl): TriggerPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TriggerPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TriggerContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. + */ + public function getContext( + string $sid + + ): TriggerContext + { + return new TriggerContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TriggerList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php new file mode 100644 index 0000000..faca817 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php @@ -0,0 +1,306 @@ +options['callbackMethod'] = $callbackMethod; + $this->options['friendlyName'] = $friendlyName; + $this->options['recurring'] = $recurring; + $this->options['triggerBy'] = $triggerBy; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * @param string $recurring + * @return $this Fluent Builder + */ + public function setRecurring(string $recurring): self + { + $this->options['recurring'] = $recurring; + return $this; + } + + /** + * @param string $triggerBy + * @return $this Fluent Builder + */ + public function setTriggerBy(string $triggerBy): self + { + $this->options['triggerBy'] = $triggerBy; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTriggerOptions ' . $options . ']'; + } +} + + + +class ReadTriggerOptions extends Options + { + /** + * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + */ + public function __construct( + + string $recurring = Values::NONE, + string $triggerBy = Values::NONE, + string $usageCategory = Values::NONE + + ) { + $this->options['recurring'] = $recurring; + $this->options['triggerBy'] = $triggerBy; + $this->options['usageCategory'] = $usageCategory; + } + + /** + * The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * + * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * @return $this Fluent Builder + */ + public function setRecurring(string $recurring): self + { + $this->options['recurring'] = $recurring; + return $this; + } + + /** + * The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * + * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * @return $this Fluent Builder + */ + public function setTriggerBy(string $triggerBy): self + { + $this->options['triggerBy'] = $triggerBy; + return $this; + } + + /** + * The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + * + * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + * @return $this Fluent Builder + */ + public function setUsageCategory(string $usageCategory): self + { + $this->options['usageCategory'] = $usageCategory; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTriggerOptions ' . $options . ']'; + } +} + +class UpdateTriggerOptions extends Options + { + /** + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using `callback_method` when the trigger fires. + * + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateTriggerOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php new file mode 100644 index 0000000..fe7bea2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TriggerInstance \Twilio\Rest\Api\V2010\Account\Usage\TriggerInstance + */ + public function buildInstance(array $payload): TriggerInstance + { + return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TriggerPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php new file mode 100644 index 0000000..1c25180 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php @@ -0,0 +1,72 @@ +solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UsageInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php new file mode 100644 index 0000000..5d32528 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php @@ -0,0 +1,129 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + } + + /** + * Access the records + */ + protected function getRecords(): RecordList + { + if (!$this->_records) { + $this->_records = new RecordList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_records; + } + + /** + * Access the triggers + */ + protected function getTriggers(): TriggerList + { + if (!$this->_triggers) { + $this->_triggers = new TriggerList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_triggers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Api.V2010.UsageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php new file mode 100644 index 0000000..ba2b5ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageInstance \Twilio\Rest\Api\V2010\Account\UsageInstance + */ + public function buildInstance(array $payload): UsageInstance + { + return new UsageInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UsagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php new file mode 100644 index 0000000..be3ef87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'validationCode' => Values::array_get($payload, 'validation_code'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php new file mode 100644 index 0000000..15c74e4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php @@ -0,0 +1,99 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds.json'; + } + + /** + * Create the ValidationRequestInstance + * + * @param string $phoneNumber The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + * @param array|Options $options Optional Arguments + * @return ValidationRequestInstance Created ValidationRequestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): ValidationRequestInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'FriendlyName' => + $options['friendlyName'], + 'CallDelay' => + $options['callDelay'], + 'Extension' => + $options['extension'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ValidationRequestInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php new file mode 100644 index 0000000..9ba9afd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php @@ -0,0 +1,148 @@ +options['friendlyName'] = $friendlyName; + $this->options['callDelay'] = $callDelay; + $this->options['extension'] = $extension; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + } + + /** + * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. + * + * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. + * @return $this Fluent Builder + */ + public function setCallDelay(int $callDelay): self + { + $this->options['callDelay'] = $callDelay; + return $this; + } + + /** + * The digits to dial after connecting the verification call. + * + * @param string $extension The digits to dial after connecting the verification call. + * @return $this Fluent Builder + */ + public function setExtension(string $extension): self + { + $this->options['extension'] = $extension; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information about the verification process to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateValidationRequestOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php new file mode 100644 index 0000000..e36a285 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ValidationRequestInstance \Twilio\Rest\Api\V2010\Account\ValidationRequestInstance + */ + public function buildInstance(array $payload): ValidationRequestInstance + { + return new ValidationRequestInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountContext.php new file mode 100644 index 0000000..1f67680 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountContext.php @@ -0,0 +1,602 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the AccountInstance + * + * @return AccountInstance Fetched AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AccountInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Updated AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AccountInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AccountInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + if (!$this->_usage) { + $this->_usage = new UsageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usage; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + if (!$this->_keys) { + $this->_keys = new KeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_keys; + } + + /** + * Access the newKeys + */ + protected function getNewKeys(): NewKeyList + { + if (!$this->_newKeys) { + $this->_newKeys = new NewKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_newKeys; + } + + /** + * Access the applications + */ + protected function getApplications(): ApplicationList + { + if (!$this->_applications) { + $this->_applications = new ApplicationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_applications; + } + + /** + * Access the incomingPhoneNumbers + */ + protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList + { + if (!$this->_incomingPhoneNumbers) { + $this->_incomingPhoneNumbers = new IncomingPhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_incomingPhoneNumbers; + } + + /** + * Access the conferences + */ + protected function getConferences(): ConferenceList + { + if (!$this->_conferences) { + $this->_conferences = new ConferenceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_conferences; + } + + /** + * Access the calls + */ + protected function getCalls(): CallList + { + if (!$this->_calls) { + $this->_calls = new CallList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_calls; + } + + /** + * Access the outgoingCallerIds + */ + protected function getOutgoingCallerIds(): OutgoingCallerIdList + { + if (!$this->_outgoingCallerIds) { + $this->_outgoingCallerIds = new OutgoingCallerIdList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_outgoingCallerIds; + } + + /** + * Access the validationRequests + */ + protected function getValidationRequests(): ValidationRequestList + { + if (!$this->_validationRequests) { + $this->_validationRequests = new ValidationRequestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_validationRequests; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + if (!$this->_transcriptions) { + $this->_transcriptions = new TranscriptionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_transcriptions; + } + + /** + * Access the connectApps + */ + protected function getConnectApps(): ConnectAppList + { + if (!$this->_connectApps) { + $this->_connectApps = new ConnectAppList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_connectApps; + } + + /** + * Access the authorizedConnectApps + */ + protected function getAuthorizedConnectApps(): AuthorizedConnectAppList + { + if (!$this->_authorizedConnectApps) { + $this->_authorizedConnectApps = new AuthorizedConnectAppList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_authorizedConnectApps; + } + + /** + * Access the tokens + */ + protected function getTokens(): TokenList + { + if (!$this->_tokens) { + $this->_tokens = new TokenList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tokens; + } + + /** + * Access the balance + */ + protected function getBalance(): BalanceList + { + if (!$this->_balance) { + $this->_balance = new BalanceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_balance; + } + + /** + * Access the sip + */ + protected function getSip(): SipList + { + if (!$this->_sip) { + $this->_sip = new SipList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sip; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the availablePhoneNumbers + */ + protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList + { + if (!$this->_availablePhoneNumbers) { + $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_availablePhoneNumbers; + } + + /** + * Access the addresses + */ + protected function getAddresses(): AddressList + { + if (!$this->_addresses) { + $this->_addresses = new AddressList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_addresses; + } + + /** + * Access the queues + */ + protected function getQueues(): QueueList + { + if (!$this->_queues) { + $this->_queues = new QueueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_queues; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the signingKeys + */ + protected function getSigningKeys(): SigningKeyList + { + if (!$this->_signingKeys) { + $this->_signingKeys = new SigningKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_signingKeys; + } + + /** + * Access the newSigningKeys + */ + protected function getNewSigningKeys(): NewSigningKeyList + { + if (!$this->_newSigningKeys) { + $this->_newSigningKeys = new NewSigningKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_newSigningKeys; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AccountContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php new file mode 100644 index 0000000..3597f38 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php @@ -0,0 +1,389 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AccountContext Context for this AccountInstance + */ + protected function proxy(): AccountContext + { + if (!$this->context) { + $this->context = new AccountContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AccountInstance + * + * @return AccountInstance Fetched AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Updated AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AccountInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + return $this->proxy()->usage; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + return $this->proxy()->keys; + } + + /** + * Access the newKeys + */ + protected function getNewKeys(): NewKeyList + { + return $this->proxy()->newKeys; + } + + /** + * Access the applications + */ + protected function getApplications(): ApplicationList + { + return $this->proxy()->applications; + } + + /** + * Access the incomingPhoneNumbers + */ + protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList + { + return $this->proxy()->incomingPhoneNumbers; + } + + /** + * Access the conferences + */ + protected function getConferences(): ConferenceList + { + return $this->proxy()->conferences; + } + + /** + * Access the calls + */ + protected function getCalls(): CallList + { + return $this->proxy()->calls; + } + + /** + * Access the outgoingCallerIds + */ + protected function getOutgoingCallerIds(): OutgoingCallerIdList + { + return $this->proxy()->outgoingCallerIds; + } + + /** + * Access the validationRequests + */ + protected function getValidationRequests(): ValidationRequestList + { + return $this->proxy()->validationRequests; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + return $this->proxy()->transcriptions; + } + + /** + * Access the connectApps + */ + protected function getConnectApps(): ConnectAppList + { + return $this->proxy()->connectApps; + } + + /** + * Access the authorizedConnectApps + */ + protected function getAuthorizedConnectApps(): AuthorizedConnectAppList + { + return $this->proxy()->authorizedConnectApps; + } + + /** + * Access the tokens + */ + protected function getTokens(): TokenList + { + return $this->proxy()->tokens; + } + + /** + * Access the balance + */ + protected function getBalance(): BalanceList + { + return $this->proxy()->balance; + } + + /** + * Access the sip + */ + protected function getSip(): SipList + { + return $this->proxy()->sip; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the availablePhoneNumbers + */ + protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList + { + return $this->proxy()->availablePhoneNumbers; + } + + /** + * Access the addresses + */ + protected function getAddresses(): AddressList + { + return $this->proxy()->addresses; + } + + /** + * Access the queues + */ + protected function getQueues(): QueueList + { + return $this->proxy()->queues; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the signingKeys + */ + protected function getSigningKeys(): SigningKeyList + { + return $this->proxy()->signingKeys; + } + + /** + * Access the newSigningKeys + */ + protected function getNewSigningKeys(): NewSigningKeyList + { + return $this->proxy()->newSigningKeys; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AccountInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountList.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountList.php new file mode 100644 index 0000000..f4aca16 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountList.php @@ -0,0 +1,198 @@ +solution = [ + ]; + + $this->uri = '/Accounts.json'; + } + + /** + * Create the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Created AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): AccountInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AccountInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountInstance 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 AccountPage Page of AccountInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountPage + { + $options = new Values($options); + + $params = Values::of([ + '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 AccountPage Page of AccountInstance + */ + public function getPage(string $targetUrl): AccountPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountContext + * + * @param string $sid The Account Sid that uniquely identifies the account to fetch + */ + public function getContext( + string $sid + + ): AccountContext + { + return new AccountContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AccountList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php new file mode 100644 index 0000000..e33e3e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php @@ -0,0 +1,216 @@ +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 to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateAccountOptions ' . $options . ']'; + } +} + + +class ReadAccountOptions extends Options + { + /** + * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. + * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + } + + /** + * Only return the Account resources with friendly names that exactly match this name. + * + * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + * + * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAccountOptions ' . $options . ']'; + } +} + +class UpdateAccountOptions extends Options + { + /** + * @param string $friendlyName Update the human-readable description of this Account + * @param string $status + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + } + + /** + * Update the human-readable description of this Account + * + * @param string $friendlyName Update the human-readable description of this Account + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateAccountOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountPage.php new file mode 100644 index 0000000..df4f11b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/AccountPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountInstance \Twilio\Rest\Api\V2010\AccountInstance + */ + public function buildInstance(array $payload): AccountInstance + { + return new AccountInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AccountPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ApiBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ApiBase.php new file mode 100644 index 0000000..84c223d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ApiBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://api.twilio.com'; + } + + + /** + * @return V2010 Version v2010 of api + */ + protected function getV2010(): V2010 { + if (!$this->_v2010) { + $this->_v2010 = new V2010($this); + } + return $this->_v2010; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Api]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Autopilot.php b/vendor/twilio/sdk/src/Twilio/Rest/Autopilot.php new file mode 100644 index 0000000..766ee01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Autopilot.php @@ -0,0 +1,32 @@ +assistants instead. + */ + protected function getAssistants(): \Twilio\Rest\Autopilot\V1\AssistantList { + echo "assistants is deprecated. Use v1->assistants instead."; + return $this->v1->assistants; + } + + /** + * @deprecated Use v1->assistants(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextAssistants(string $sid): \Twilio\Rest\Autopilot\V1\AssistantContext { + echo "assistants(\$sid) is deprecated. Use v1->assistants(\$sid) instead."; + return $this->v1->assistants($sid); + } + + /** + * @deprecated Use v1->restoreAssistant instead + */ + protected function getRestoreAssistant(): \Twilio\Rest\Autopilot\V1\RestoreAssistantList { + echo "restoreAssistant is deprecated. Use v1->restoreAssistant instead."; + return $this->v1->restoreAssistant; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports.php new file mode 100644 index 0000000..1192b13 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports.php @@ -0,0 +1,44 @@ +exports instead. + */ + protected function getExports(): \Twilio\Rest\Bulkexports\V1\ExportList { + echo "exports is deprecated. Use v1->exports instead."; + return $this->v1->exports; + } + + /** + * @deprecated Use v1->exports(\$resourceType) instead. + * @param string $resourceType The type of communication – Messages, Calls, + * Conferences, and Participants + */ + protected function contextExports(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportContext { + echo "exports(\$resourceType) is deprecated. Use v1->exports(\$resourceType) instead."; + return $this->v1->exports($resourceType); + } + + /** + * @deprecated Use v1->exportConfiguration instead. + */ + protected function getExportConfiguration(): \Twilio\Rest\Bulkexports\V1\ExportConfigurationList { + echo "exportConfiguration is deprecated. Use v1->exportConfiguration instead."; + return $this->v1->exportConfiguration; + } + + /** + * @deprecated Use v1->exportConfiguration(\$resourceType) instead. + * @param string $resourceType The type of communication – Messages, Calls, + * Conferences, and Participants + */ + protected function contextExportConfiguration(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext { + echo "rexportConfiguration(\$resourceType) is deprecated. Use v1->exportConfiguration(\$resourceType) instead."; + return $this->v1->exportConfiguration($resourceType); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1.php new file mode 100644 index 0000000..7c20ab1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1.php @@ -0,0 +1,106 @@ +version = 'v1'; + } + + protected function getExports(): ExportList + { + if (!$this->_exports) { + $this->_exports = new ExportList($this); + } + return $this->_exports; + } + + protected function getExportConfiguration(): ExportConfigurationList + { + if (!$this->_exportConfiguration) { + $this->_exportConfiguration = new ExportConfigurationList($this); + } + return $this->_exportConfiguration; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Bulkexports.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php new file mode 100644 index 0000000..eda2c62 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php @@ -0,0 +1,89 @@ +solution = [ + 'resourceType' => + $resourceType, + 'day' => + $day, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Days/' . \rawurlencode($day) + .''; + } + + /** + * Fetch the DayInstance + * + * @return DayInstance Fetched DayInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DayInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DayInstance( + $this->version, + $payload, + $this->solution['resourceType'], + $this->solution['day'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.DayContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php new file mode 100644 index 0000000..1009fa7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + 'day' => Values::array_get($payload, 'day'), + 'size' => Values::array_get($payload, 'size'), + 'createDate' => Values::array_get($payload, 'create_date'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + ]; + + $this->solution = ['resourceType' => $resourceType, 'day' => $day ?: $this->properties['day'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DayContext Context for this DayInstance + */ + protected function proxy(): DayContext + { + if (!$this->context) { + $this->context = new DayContext( + $this->version, + $this->solution['resourceType'], + $this->solution['day'] + ); + } + + return $this->context; + } + + /** + * Fetch the DayInstance + * + * @return DayInstance Fetched DayInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DayInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.DayInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayList.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayList.php new file mode 100644 index 0000000..5bdb000 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayList.php @@ -0,0 +1,168 @@ +solution = [ + 'resourceType' => + $resourceType, + + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Days'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DayPage Page of DayInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DayPage + { + + $params = Values::of([ + '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 DayPage Page of DayInstance + */ + public function getPage(string $targetUrl): DayPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DayPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DayContext + * + * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day + */ + public function getContext( + string $day + + ): DayContext + { + return new DayContext( + $this->version, + $this->solution['resourceType'], + $day + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.DayList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayPage.php new file mode 100644 index 0000000..5ce6b8c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DayInstance \Twilio\Rest\Bulkexports\V1\Export\DayInstance + */ + public function buildInstance(array $payload): DayInstance + { + return new DayInstance($this->version, $payload, $this->solution['resourceType']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.DayPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php new file mode 100644 index 0000000..df0a1e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'startDay' => Values::array_get($payload, 'start_day'), + 'endDay' => Values::array_get($payload, 'end_day'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'email' => Values::array_get($payload, 'email'), + 'jobSid' => Values::array_get($payload, 'job_sid'), + 'details' => Values::array_get($payload, 'details'), + 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), + 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php new file mode 100644 index 0000000..afcbd04 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php @@ -0,0 +1,194 @@ +solution = [ + 'resourceType' => + $resourceType, + + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Jobs'; + } + + /** + * Create the ExportCustomJobInstance + * + * @param string $startDay The start day for the custom export specified as a string in the format of yyyy-mm-dd + * @param string $endDay The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day. + * @param string $friendlyName The friendly name specified when creating the job + * @param array|Options $options Optional Arguments + * @return ExportCustomJobInstance Created ExportCustomJobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $startDay, string $endDay, string $friendlyName, array $options = []): ExportCustomJobInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StartDay' => + $startDay, + 'EndDay' => + $endDay, + 'FriendlyName' => + $friendlyName, + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'Email' => + $options['email'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ExportCustomJobInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Reads ExportCustomJobInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExportCustomJobInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExportCustomJobInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExportCustomJobInstance 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 ExportCustomJobPage Page of ExportCustomJobInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExportCustomJobPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExportCustomJobPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExportCustomJobInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExportCustomJobPage Page of ExportCustomJobInstance + */ + public function getPage(string $targetUrl): ExportCustomJobPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExportCustomJobPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php new file mode 100644 index 0000000..3e90484 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php @@ -0,0 +1,114 @@ +options['webhookUrl'] = $webhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['email'] = $email; + } + + /** + * The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. + * + * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. + * + * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. + * + * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Bulkexports.V1.CreateExportCustomJobOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php new file mode 100644 index 0000000..a21ed26 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportCustomJobInstance \Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobInstance + */ + public function buildInstance(array $payload): ExportCustomJobInstance + { + return new ExportCustomJobInstance($this->version, $payload, $this->solution['resourceType']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php new file mode 100644 index 0000000..e65d905 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php @@ -0,0 +1,97 @@ +solution = [ + 'jobSid' => + $jobSid, + ]; + + $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) + .''; + } + + /** + * Delete the JobInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the JobInstance + * + * @return JobInstance Fetched JobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): JobInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new JobInstance( + $this->version, + $payload, + $this->solution['jobSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.JobContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php new file mode 100644 index 0000000..e7fcd3a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'details' => Values::array_get($payload, 'details'), + 'startDay' => Values::array_get($payload, 'start_day'), + 'endDay' => Values::array_get($payload, 'end_day'), + 'jobSid' => Values::array_get($payload, 'job_sid'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'email' => Values::array_get($payload, 'email'), + 'url' => Values::array_get($payload, 'url'), + 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), + 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), + ]; + + $this->solution = ['jobSid' => $jobSid ?: $this->properties['jobSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return JobContext Context for this JobInstance + */ + protected function proxy(): JobContext + { + if (!$this->context) { + $this->context = new JobContext( + $this->version, + $this->solution['jobSid'] + ); + } + + return $this->context; + } + + /** + * Delete the JobInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the JobInstance + * + * @return JobInstance Fetched JobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): JobInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.JobInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobList.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobList.php new file mode 100644 index 0000000..f37790e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a JobContext + * + * @param string $jobSid The unique string that that we created to identify the Bulk Export job + */ + public function getContext( + string $jobSid + + ): JobContext + { + return new JobContext( + $this->version, + $jobSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.JobList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobPage.php new file mode 100644 index 0000000..7136636 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return JobInstance \Twilio\Rest\Bulkexports\V1\Export\JobInstance + */ + public function buildInstance(array $payload): JobInstance + { + return new JobInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.JobPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php new file mode 100644 index 0000000..7ad14dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php @@ -0,0 +1,117 @@ +solution = [ + 'resourceType' => + $resourceType, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Configuration'; + } + + /** + * Fetch the ExportConfigurationInstance + * + * @return ExportConfigurationInstance Fetched ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExportConfigurationInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Update the ExportConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ExportConfigurationInstance Updated ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ExportConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ExportConfigurationInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php new file mode 100644 index 0000000..48db1f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php @@ -0,0 +1,137 @@ +properties = [ + '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 = ['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 ExportConfigurationContext Context for this ExportConfigurationInstance + */ + protected function proxy(): ExportConfigurationContext + { + if (!$this->context) { + $this->context = new ExportConfigurationContext( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExportConfigurationInstance + * + * @return ExportConfigurationInstance Fetched ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExportConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ExportConfigurationInstance Updated ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ExportConfigurationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php new file mode 100644 index 0000000..96451d5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a ExportConfigurationContext + * + * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants + */ + public function getContext( + string $resourceType + + ): ExportConfigurationContext + { + return new ExportConfigurationContext( + $this->version, + $resourceType + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php new file mode 100644 index 0000000..81b74ff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php @@ -0,0 +1,114 @@ +options['enabled'] = $enabled; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + } + + /** + * If true, Twilio will automatically generate every day's file when the day is over. + * + * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Stores the URL destination for the method specified in webhook_method. + * + * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url + * + * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Bulkexports.V1.UpdateExportConfigurationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php new file mode 100644 index 0000000..b3341c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportConfigurationInstance \Twilio\Rest\Bulkexports\V1\ExportConfigurationInstance + */ + public function buildInstance(array $payload): ExportConfigurationInstance + { + return new ExportConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportContext.php new file mode 100644 index 0000000..f4a6bc3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportContext.php @@ -0,0 +1,159 @@ +solution = [ + 'resourceType' => + $resourceType, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .''; + } + + /** + * Fetch the ExportInstance + * + * @return ExportInstance Fetched ExportInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExportInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Access the exportCustomJobs + */ + protected function getExportCustomJobs(): ExportCustomJobList + { + if (!$this->_exportCustomJobs) { + $this->_exportCustomJobs = new ExportCustomJobList( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->_exportCustomJobs; + } + + /** + * Access the days + */ + protected function getDays(): DayList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportInstance.php new file mode 100644 index 0000000..96e7abf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 ExportContext Context for this ExportInstance + */ + protected function proxy(): ExportContext + { + if (!$this->context) { + $this->context = new ExportContext( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExportInstance + * + * @return ExportInstance Fetched ExportInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the exportCustomJobs + */ + protected function getExportCustomJobs(): ExportCustomJobList + { + return $this->proxy()->exportCustomJobs; + } + + /** + * Access the days + */ + protected function getDays(): DayList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportList.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportList.php new file mode 100644 index 0000000..58e8448 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportList.php @@ -0,0 +1,122 @@ +solution = [ + ]; + } + + /** + * Constructs a ExportContext + * + * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants + */ + public function getContext( + string $resourceType + + ): ExportContext + { + return new ExportContext( + $this->version, + $resourceType + ); + } + + /** + * Access the jobs + */ + protected function getJobs(): JobList + { + if (!$this->_jobs) { + $this->_jobs = new JobList( + $this->version + ); + } + return $this->_jobs; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Bulkexports.V1.ExportList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportPage.php new file mode 100644 index 0000000..15ecb1a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Bulkexports/V1/ExportPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportInstance \Twilio\Rest\Bulkexports\V1\ExportInstance + */ + public function buildInstance(array $payload): ExportInstance + { + return new ExportInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/BulkexportsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/BulkexportsBase.php new file mode 100644 index 0000000..4c161a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/BulkexportsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://bulkexports.twilio.com'; + } + + + /** + * @return V1 Version v1 of bulkexports + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Bulkexports]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat.php new file mode 100644 index 0000000..fadde8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat.php @@ -0,0 +1,60 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Chat\V2\CredentialList { + echo "credentials is deprecated. Use v2->credentials instead."; + return $this->v2->credentials; + } + + /** + * @deprecated Use v2->credentials(\$sid) instead. + * @param string $sid The SID of the Credential resource to fetch + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Chat\V2\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; + return $this->v2->credentials($sid); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\Chat\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Chat\V2\ServiceContext { + echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } + + /** + * @deprecated Use v3->channels instead. + */ + protected function getChannels(): \Twilio\Rest\Chat\V3\ChannelList { + echo "channels is deprecated. Use v3->channels instead."; + return $this->v3->channels; + } + + /** + * @deprecated Use v3->channels(\$serviceSid, \$sid) instead. + * @param string $serviceSid Service Sid. + * @param string $sid A string that uniquely identifies this Channel. + */ + protected function contextChannels(string $serviceSid, string $sid): \Twilio\Rest\Chat\V3\ChannelContext { + echo "channels(\$serviceSid, \$sid) is deprecated. Use v3->channels(\$serviceSid, \$sid) instead."; + return $this->v3->channels($serviceSid, $sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1.php new file mode 100644 index 0000000..b4d3f71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Chat.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php new file mode 100644 index 0000000..ed57606 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php new file mode 100644 index 0000000..476973c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialList.php new file mode 100644 index 0000000..a0d59db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php new file mode 100644 index 0000000..aa037ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php new file mode 100644 index 0000000..44c73e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Chat\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php new file mode 100644 index 0000000..42549e4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php new file mode 100644 index 0000000..aa4a2dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php new file mode 100644 index 0000000..c0b95d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance 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 InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + '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 InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.InviteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php new file mode 100644 index 0000000..7271fd0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php new file mode 100644 index 0000000..9c3e840 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\Chat\V1\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.InvitePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php new file mode 100644 index 0000000..2a6a675 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php new file mode 100644 index 0000000..c3e3545 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php new file mode 100644 index 0000000..600ba0c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + '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 MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MemberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php new file mode 100644 index 0000000..ff7edc1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php @@ -0,0 +1,202 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateMemberOptions ' . $options . ']'; + } +} + + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php new file mode 100644 index 0000000..45851a1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Chat\V1\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MemberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php new file mode 100644 index 0000000..16886e7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php new file mode 100644 index 0000000..42be7e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php @@ -0,0 +1,170 @@ +properties = [ + '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 = ['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 MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php new file mode 100644 index 0000000..f18a5d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $body, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $body, + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php new file mode 100644 index 0000000..359f26c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php @@ -0,0 +1,220 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + } + + /** + * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. + * + * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param string $attributes A valid JSON string that contains application-specific data. + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + } + + /** + * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php new file mode 100644 index 0000000..19373f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Chat\V1\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php new file mode 100644 index 0000000..dda1d3b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php @@ -0,0 +1,236 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php new file mode 100644 index 0000000..a37df54 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php @@ -0,0 +1,201 @@ +properties = [ + '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 = ['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 ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php new file mode 100644 index 0000000..dcff76d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php @@ -0,0 +1,210 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + '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 ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php new file mode 100644 index 0000000..2bb4e24 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php @@ -0,0 +1,272 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + +class ReadChannelOptions extends Options + { + /** + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @param string $attributes A valid JSON string that contains application-specific data. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php new file mode 100644 index 0000000..fd4ba59 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V1\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php new file mode 100644 index 0000000..5d6ab55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php new file mode 100644 index 0000000..206eb8b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + '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 = ['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 RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php new file mode 100644 index 0000000..2a665cf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php new file mode 100644 index 0000000..861b266 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Chat\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php new file mode 100644 index 0000000..4b01f99 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php @@ -0,0 +1,96 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserChannelInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php new file mode 100644 index 0000000..bd406c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php @@ -0,0 +1,157 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + '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 UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $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(): string + { + return '[Twilio.Chat.V1.UserChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php new file mode 100644 index 0000000..7399236 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\Chat\V1\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php new file mode 100644 index 0000000..2ea37c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php new file mode 100644 index 0000000..080e6be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php @@ -0,0 +1,181 @@ +properties = [ + '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 = ['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 UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php new file mode 100644 index 0000000..9b4bc93 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). This value is often a username or email address. See the Identity documentation for more details. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php new file mode 100644 index 0000000..3fb4738 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php @@ -0,0 +1,206 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php new file mode 100644 index 0000000..e439d88 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Chat\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php new file mode 100644 index 0000000..5aaa466 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php @@ -0,0 +1,329 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Webhooks.OnMessageSend.Url' => + $options['webhooksOnMessageSendUrl'], + 'Webhooks.OnMessageSend.Method' => + $options['webhooksOnMessageSendMethod'], + 'Webhooks.OnMessageUpdate.Url' => + $options['webhooksOnMessageUpdateUrl'], + 'Webhooks.OnMessageUpdate.Method' => + $options['webhooksOnMessageUpdateMethod'], + 'Webhooks.OnMessageRemove.Url' => + $options['webhooksOnMessageRemoveUrl'], + 'Webhooks.OnMessageRemove.Method' => + $options['webhooksOnMessageRemoveMethod'], + 'Webhooks.OnChannelAdd.Url' => + $options['webhooksOnChannelAddUrl'], + 'Webhooks.OnChannelAdd.Method' => + $options['webhooksOnChannelAddMethod'], + 'Webhooks.OnChannelDestroy.Url' => + $options['webhooksOnChannelDestroyUrl'], + 'Webhooks.OnChannelDestroy.Method' => + $options['webhooksOnChannelDestroyMethod'], + 'Webhooks.OnChannelUpdate.Url' => + $options['webhooksOnChannelUpdateUrl'], + 'Webhooks.OnChannelUpdate.Method' => + $options['webhooksOnChannelUpdateMethod'], + 'Webhooks.OnMemberAdd.Url' => + $options['webhooksOnMemberAddUrl'], + 'Webhooks.OnMemberAdd.Method' => + $options['webhooksOnMemberAddMethod'], + 'Webhooks.OnMemberRemove.Url' => + $options['webhooksOnMemberRemoveUrl'], + 'Webhooks.OnMemberRemove.Method' => + $options['webhooksOnMemberRemoveMethod'], + 'Webhooks.OnMessageSent.Url' => + $options['webhooksOnMessageSentUrl'], + 'Webhooks.OnMessageSent.Method' => + $options['webhooksOnMessageSentMethod'], + 'Webhooks.OnMessageUpdated.Url' => + $options['webhooksOnMessageUpdatedUrl'], + 'Webhooks.OnMessageUpdated.Method' => + $options['webhooksOnMessageUpdatedMethod'], + 'Webhooks.OnMessageRemoved.Url' => + $options['webhooksOnMessageRemovedUrl'], + 'Webhooks.OnMessageRemoved.Method' => + $options['webhooksOnMessageRemovedMethod'], + 'Webhooks.OnChannelAdded.Url' => + $options['webhooksOnChannelAddedUrl'], + 'Webhooks.OnChannelAdded.Method' => + $options['webhooksOnChannelAddedMethod'], + 'Webhooks.OnChannelDestroyed.Url' => + $options['webhooksOnChannelDestroyedUrl'], + 'Webhooks.OnChannelDestroyed.Method' => + $options['webhooksOnChannelDestroyedMethod'], + 'Webhooks.OnChannelUpdated.Url' => + $options['webhooksOnChannelUpdatedUrl'], + 'Webhooks.OnChannelUpdated.Method' => + $options['webhooksOnChannelUpdatedMethod'], + 'Webhooks.OnMemberAdded.Url' => + $options['webhooksOnMemberAddedUrl'], + 'Webhooks.OnMemberAdded.Method' => + $options['webhooksOnMemberAddedMethod'], + 'Webhooks.OnMemberRemoved.Url' => + $options['webhooksOnMemberRemovedUrl'], + 'Webhooks.OnMemberRemoved.Method' => + $options['webhooksOnMemberRemovedMethod'], + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php new file mode 100644 index 0000000..60a6e91 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php @@ -0,0 +1,213 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceList.php new file mode 100644 index 0000000..e968dcf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceList.php @@ -0,0 +1,187 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php new file mode 100644 index 0000000..1068d53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php @@ -0,0 +1,1038 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * + * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * + * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * + * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * + * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * + * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * + * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. + * + * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self + { + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_send.url`. + * + * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self + { + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. + * + * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self + { + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_update.url`. + * + * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self + { + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. + * + * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self + { + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_remove.url`. + * + * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self + { + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. + * + * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self + { + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_add.url`. + * + * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self + { + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. + * + * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self + { + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. + * + * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self + { + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. + * + * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self + { + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_update.url`. + * + * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self + { + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. + * + * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self + { + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_add.url`. + * + * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self + { + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. + * + * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self + { + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_remove.url`. + * + * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self + { + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. + * + * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self + { + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_sent` event`. + * + * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self + { + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. + * + * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self + { + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_updated.url`. + * + * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self + { + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. + * + * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self + { + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_removed.url`. + * + * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self + { + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. + * + * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self + { + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event`. + * + * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self + { + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. + * + * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self + { + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. + * + * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self + { + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * + * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self + { + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * + * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self + { + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * + * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self + { + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * + * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self + { + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. + * + * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self + { + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_removed.url`. + * + * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self + { + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + return $this; + } + + /** + * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * + * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * + * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServicePage.php new file mode 100644 index 0000000..bf52c10 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Chat\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2.php new file mode 100644 index 0000000..9c8011e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2.php @@ -0,0 +1,107 @@ +version = 'v2'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Chat.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/.openapi-generator-ignore b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php new file mode 100644 index 0000000..ecbe6fe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php new file mode 100644 index 0000000..2e73c1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialList.php new file mode 100644 index 0000000..3d0e001 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The SID of the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php new file mode 100644 index 0000000..fdd0e1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php new file mode 100644 index 0000000..74e3942 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Chat\V2\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php new file mode 100644 index 0000000..ed46c12 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php new file mode 100644 index 0000000..084bf70 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php @@ -0,0 +1,152 @@ +properties = [ + '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 = ['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 BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php new file mode 100644 index 0000000..205175f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance 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 BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + '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 BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The SID of the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.BindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php new file mode 100644 index 0000000..40e9af3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php new file mode 100644 index 0000000..1e75544 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Chat\V2\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.BindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php new file mode 100644 index 0000000..3911505 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php new file mode 100644 index 0000000..86bbe5d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php new file mode 100644 index 0000000..965b193 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance 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 InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + '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 InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid The SID of the Invite resource to delete. + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.InviteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php new file mode 100644 index 0000000..ad926de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php new file mode 100644 index 0000000..8a513c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\Chat\V2\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.InvitePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php new file mode 100644 index 0000000..296f262 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php @@ -0,0 +1,154 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php new file mode 100644 index 0000000..38ee4ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + ]; + + $this->solution = ['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 MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php new file mode 100644 index 0000000..e8d4ffd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + '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 MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MemberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php new file mode 100644 index 0000000..79003e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php @@ -0,0 +1,450 @@ +options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateMemberOptions ' . $options . ']'; + } +} + +class DeleteMemberOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteMemberOptions ' . $options . ']'; + } +} + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php new file mode 100644 index 0000000..5216f63 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Chat\V2\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MemberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php new file mode 100644 index 0000000..bed59b8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php @@ -0,0 +1,154 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'From' => + $options['from'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php new file mode 100644 index 0000000..f98cd61 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php @@ -0,0 +1,177 @@ +properties = [ + '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 = ['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 MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php new file mode 100644 index 0000000..61c612f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php @@ -0,0 +1,225 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The SID of the Message resource to delete. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php new file mode 100644 index 0000000..e85bc39 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php @@ -0,0 +1,468 @@ +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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. + * + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. + * + * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $lastUpdatedBy = Values::NONE, + string $from = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['from'] = $from; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php new file mode 100644 index 0000000..d060e3e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Chat\V2\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php new file mode 100644 index 0000000..fbeae95 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php @@ -0,0 +1,151 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php new file mode 100644 index 0000000..47b69e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'type' => Values::array_get($payload, 'type'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['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 WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php new file mode 100644 index 0000000..45f7cff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php @@ -0,0 +1,220 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid The SID of the Channel Webhook resource to delete. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php new file mode 100644 index 0000000..d661c61 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php @@ -0,0 +1,310 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * The URL of the webhook to call using the `configuration.method`. + * + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. + * + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @param string $configurationMethod + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE, + int $configurationRetryCount = Values::INT_NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * The URL of the webhook to call using the `configuration.method`. + * + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php new file mode 100644 index 0000000..29ae519 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Chat\V2\Service\Channel\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php new file mode 100644 index 0000000..788e4a9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php @@ -0,0 +1,266 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php new file mode 100644 index 0000000..f270ab3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php @@ -0,0 +1,212 @@ +properties = [ + '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 = ['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 ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php new file mode 100644 index 0000000..4449629 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + '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 ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php new file mode 100644 index 0000000..caa22fe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php @@ -0,0 +1,466 @@ +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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The `identity` of the User that created the channel. Default is: `system`. + * + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateChannelOptions ' . $options . ']'; + } +} + +class DeleteChannelOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteChannelOptions ' . $options . ']'; + } +} + + +class ReadChannelOptions extends Options + { + /** + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $createdBy = Values::NONE, + string $xTwilioWebhookEnabled = 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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The `identity` of the User that created the channel. Default is: `system`. + * + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php new file mode 100644 index 0000000..40aac39 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V2\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php new file mode 100644 index 0000000..edd4437 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php new file mode 100644 index 0000000..f71601a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + '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 = ['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 RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php new file mode 100644 index 0000000..3028be0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php new file mode 100644 index 0000000..d953103 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Chat\V2\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php new file mode 100644 index 0000000..6c41665 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserBindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserBindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php new file mode 100644 index 0000000..b350adb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 UserBindingContext Context for this UserBindingInstance + */ + protected function proxy(): UserBindingContext + { + if (!$this->context) { + $this->context = new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php new file mode 100644 index 0000000..99125db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserBindingInstance 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 UserBindingPage Page of UserBindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserBindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + '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 UserBindingPage Page of UserBindingInstance + */ + public function getPage(string $targetUrl): UserBindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserBindingContext + * + * @param string $sid The SID of the User Binding resource to delete. + */ + public function getContext( + string $sid + + ): UserBindingContext + { + return new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserBindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php new file mode 100644 index 0000000..2912f7c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php @@ -0,0 +1,80 @@ +options['bindingType'] = $bindingType; + } + + /** + * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadUserBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php new file mode 100644 index 0000000..60355d5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserBindingInstance \Twilio\Rest\Chat\V2\Service\User\UserBindingInstance + */ + public function buildInstance(array $payload): UserBindingInstance + { + return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserBindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php new file mode 100644 index 0000000..319658b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php @@ -0,0 +1,148 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'channelSid' => + $channelSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels/' . \rawurlencode($channelSid) + .''; + } + + /** + * Delete the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php new file mode 100644 index 0000000..343453c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserChannelContext Context for this UserChannelInstance + */ + protected function proxy(): UserChannelContext + { + if (!$this->context) { + $this->context = new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php new file mode 100644 index 0000000..2f83e71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + '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 UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserChannelContext + * + * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. + */ + public function getContext( + string $channelSid + + ): UserChannelContext + { + return new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $channelSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php new file mode 100644 index 0000000..ff59988 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php @@ -0,0 +1,166 @@ +options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteUserChannelOptions ' . $options . ']'; + } +} + + + +class UpdateUserChannelOptions extends Options + { + /** + * @param string $notificationLevel + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + */ + public function __construct( + + string $notificationLevel = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null + + ) { + $this->options['notificationLevel'] = $notificationLevel; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateUserChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php new file mode 100644 index 0000000..b50deef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\Chat\V2\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php new file mode 100644 index 0000000..be526be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + if (!$this->_userBindings) { + $this->_userBindings = new UserBindingList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php new file mode 100644 index 0000000..2b5f3bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php @@ -0,0 +1,191 @@ +properties = [ + '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 = ['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 UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + return $this->proxy()->userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php new file mode 100644 index 0000000..af20839 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or email address. See the Identity documentation for more info. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php new file mode 100644 index 0000000..5820ca0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php @@ -0,0 +1,242 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php new file mode 100644 index 0000000..3034c9f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Chat\V2\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php new file mode 100644 index 0000000..5383d4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php @@ -0,0 +1,302 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php new file mode 100644 index 0000000..66ae133 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php @@ -0,0 +1,227 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceList.php new file mode 100644 index 0000000..ca6b0b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceList.php @@ -0,0 +1,187 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php new file mode 100644 index 0000000..3b398a8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php @@ -0,0 +1,624 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + } + + /** + * A descriptive string that you create to describe the resource. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * + * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * + * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * + * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * + * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a channel. The default is `false`. + * + * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self + { + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + return $this; + } + + /** + * Whether the new message badge is enabled. The default is `false`. + * + * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self + { + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + return $this; + } + + /** + * Whether to send a notification when a member is added to a channel. The default is `false`. + * + * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self + { + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a channel. The default is `false`. + * + * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self + { + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + return $this; + } + + /** + * Whether to send a notification when a user is invited to a channel. The default is `false`. + * + * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self + { + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + return $this; + } + + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * + * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * + * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * The message to send when a media message has no text. Can be used as placeholder message. + * + * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. + * @return $this Fluent Builder + */ + public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self + { + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + return $this; + } + + /** + * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. + * + * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. + * @return $this Fluent Builder + */ + public function setPreWebhookRetryCount(int $preWebhookRetryCount): self + { + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + return $this; + } + + /** + * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. + * + * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. + * @return $this Fluent Builder + */ + public function setPostWebhookRetryCount(int $postWebhookRetryCount): self + { + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + return $this; + } + + /** + * Whether to log notifications. The default is `false`. + * + * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self + { + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServicePage.php new file mode 100644 index 0000000..797910e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Chat\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3.php new file mode 100644 index 0000000..2a332d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3.php @@ -0,0 +1,95 @@ +version = 'v3'; + } + + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList($this); + } + return $this->_channels; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Chat.V3]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/.openapi-generator-ignore b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelContext.php new file mode 100644 index 0000000..21d779a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $options['type'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V3.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelInstance.php new file mode 100644 index 0000000..addb9ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelInstance.php @@ -0,0 +1,146 @@ +properties = [ + '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'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid ?: $this->properties['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 ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V3.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelList.php new file mode 100644 index 0000000..3aa6cef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a ChannelContext + * + * @param string $serviceSid The unique SID identifier of the Service. + * + * @param string $sid A 34 character string that uniquely identifies this Channel. + */ + public function getContext( + string $serviceSid + , string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $serviceSid, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V3.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelOptions.php new file mode 100644 index 0000000..4b85d20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelOptions.php @@ -0,0 +1,110 @@ +options['type'] = $type; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V3.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelPage.php new file mode 100644 index 0000000..6888e66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Chat/V3/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V3\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V3.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ChatBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ChatBase.php new file mode 100644 index 0000000..2f5c9f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ChatBase.php @@ -0,0 +1,114 @@ +baseUrl = 'https://chat.twilio.com'; + } + + + /** + * @return V1 Version v1 of chat + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of chat + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * @return V3 Version v3 of chat + */ + protected function getV3(): V3 { + if (!$this->_v3) { + $this->_v3 = new V3($this); + } + return $this->_v3; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Chat]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Client.php b/vendor/twilio/sdk/src/Twilio/Rest/Client.php new file mode 100644 index 0000000..7903778 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Client.php @@ -0,0 +1,708 @@ +_accounts) { + $this->_accounts = new Accounts($this); + } + return $this->_accounts; + } + /** + * Access the Api Twilio Domain + * + * @return Api Api Twilio Domain + */ + protected function getApi(): Api { + if (!$this->_api) { + $this->_api = new Api($this); + } + return $this->_api; + } + /** + * Access the Bulkexports Twilio Domain + * + * @return Bulkexports Bulkexports Twilio Domain + */ + protected function getBulkexports(): Bulkexports { + if (!$this->_bulkexports) { + $this->_bulkexports = new Bulkexports($this); + } + return $this->_bulkexports; + } + /** + * Access the Chat Twilio Domain + * + * @return Chat Chat Twilio Domain + */ + protected function getChat(): Chat { + if (!$this->_chat) { + $this->_chat = new Chat($this); + } + return $this->_chat; + } + /** + * Access the Content Twilio Domain + * + * @return Content Content Twilio Domain + */ + protected function getContent(): Content { + if (!$this->_content) { + $this->_content = new Content($this); + } + return $this->_content; + } + /** + * Access the Conversations Twilio Domain + * + * @return Conversations Conversations Twilio Domain + */ + protected function getConversations(): Conversations { + if (!$this->_conversations) { + $this->_conversations = new Conversations($this); + } + return $this->_conversations; + } + /** + * Access the Events Twilio Domain + * + * @return Events Events Twilio Domain + */ + protected function getEvents(): Events { + if (!$this->_events) { + $this->_events = new Events($this); + } + return $this->_events; + } + /** + * Access the FlexApi Twilio Domain + * + * @return FlexApi FlexApi Twilio Domain + */ + protected function getFlexApi(): FlexApi { + if (!$this->_flexApi) { + $this->_flexApi = new FlexApi($this); + } + return $this->_flexApi; + } + /** + * Access the FrontlineApi Twilio Domain + * + * @return FrontlineApi FrontlineApi Twilio Domain + */ + protected function getFrontlineApi(): FrontlineApi { + if (!$this->_frontlineApi) { + $this->_frontlineApi = new FrontlineApi($this); + } + return $this->_frontlineApi; + } + /** + * Access the PreviewIam Twilio Domain + * + * @return PreviewIam PreviewIam Twilio Domain + */ + protected function getPreviewIam(): PreviewIam { + if (!$this->_previewIam) { + $this->_previewIam = new PreviewIam($this); + } + return $this->_previewIam; + } + /** + * Access the Insights Twilio Domain + * + * @return Insights Insights Twilio Domain + */ + protected function getInsights(): Insights { + if (!$this->_insights) { + $this->_insights = new Insights($this); + } + return $this->_insights; + } + /** + * Access the Intelligence Twilio Domain + * + * @return Intelligence Intelligence Twilio Domain + */ + protected function getIntelligence(): Intelligence { + if (!$this->_intelligence) { + $this->_intelligence = new Intelligence($this); + } + return $this->_intelligence; + } + /** + * Access the IpMessaging Twilio Domain + * + * @return IpMessaging IpMessaging Twilio Domain + */ + protected function getIpMessaging(): IpMessaging { + if (!$this->_ipMessaging) { + $this->_ipMessaging = new IpMessaging($this); + } + return $this->_ipMessaging; + } + /** + * Access the Lookups Twilio Domain + * + * @return Lookups Lookups Twilio Domain + */ + protected function getLookups(): Lookups { + if (!$this->_lookups) { + $this->_lookups = new Lookups($this); + } + return $this->_lookups; + } + /** + * Access the Marketplace Twilio Domain + * + * @return Marketplace Marketplace Twilio Domain + */ + protected function getMarketplace(): Marketplace { + if (!$this->_marketplace) { + $this->_marketplace = new Marketplace($this); + } + return $this->_marketplace; + } + /** + * Access the Messaging Twilio Domain + * + * @return Messaging Messaging Twilio Domain + */ + protected function getMessaging(): Messaging { + if (!$this->_messaging) { + $this->_messaging = new Messaging($this); + } + return $this->_messaging; + } + /** + * Access the Microvisor Twilio Domain + * + * @return Microvisor Microvisor Twilio Domain + */ + protected function getMicrovisor(): Microvisor { + if (!$this->_microvisor) { + $this->_microvisor = new Microvisor($this); + } + return $this->_microvisor; + } + /** + * Access the Monitor Twilio Domain + * + * @return Monitor Monitor Twilio Domain + */ + protected function getMonitor(): Monitor { + if (!$this->_monitor) { + $this->_monitor = new Monitor($this); + } + return $this->_monitor; + } + /** + * Access the Notify Twilio Domain + * + * @return Notify Notify Twilio Domain + */ + protected function getNotify(): Notify { + if (!$this->_notify) { + $this->_notify = new Notify($this); + } + return $this->_notify; + } + /** + * Access the Numbers Twilio Domain + * + * @return Numbers Numbers Twilio Domain + */ + protected function getNumbers(): Numbers { + if (!$this->_numbers) { + $this->_numbers = new Numbers($this); + } + return $this->_numbers; + } + /** + * Access the Oauth Twilio Domain + * + * @return Oauth Oauth Twilio Domain + */ + protected function getOauth(): Oauth { + if (!$this->_oauth) { + $this->_oauth = new Oauth($this); + } + return $this->_oauth; + } + /** + * Access the Preview Twilio Domain + * + * @return Preview Preview Twilio Domain + */ + protected function getPreview(): Preview { + if (!$this->_preview) { + $this->_preview = new Preview($this); + } + return $this->_preview; + } + /** + * Access the Pricing Twilio Domain + * + * @return Pricing Pricing Twilio Domain + */ + protected function getPricing(): Pricing { + if (!$this->_pricing) { + $this->_pricing = new Pricing($this); + } + return $this->_pricing; + } + /** + * Access the Proxy Twilio Domain + * + * @return Proxy Proxy Twilio Domain + */ + protected function getProxy(): Proxy { + if (!$this->_proxy) { + $this->_proxy = new Proxy($this); + } + return $this->_proxy; + } + /** + * Access the Routes Twilio Domain + * + * @return Routes Routes Twilio Domain + */ + protected function getRoutes(): Routes { + if (!$this->_routes) { + $this->_routes = new Routes($this); + } + return $this->_routes; + } + /** + * Access the Serverless Twilio Domain + * + * @return Serverless Serverless Twilio Domain + */ + protected function getServerless(): Serverless { + if (!$this->_serverless) { + $this->_serverless = new Serverless($this); + } + return $this->_serverless; + } + /** + * Access the Studio Twilio Domain + * + * @return Studio Studio Twilio Domain + */ + protected function getStudio(): Studio { + if (!$this->_studio) { + $this->_studio = new Studio($this); + } + return $this->_studio; + } + /** + * Access the Supersim Twilio Domain + * + * @return Supersim Supersim Twilio Domain + */ + protected function getSupersim(): Supersim { + if (!$this->_supersim) { + $this->_supersim = new Supersim($this); + } + return $this->_supersim; + } + /** + * Access the Sync Twilio Domain + * + * @return Sync Sync Twilio Domain + */ + protected function getSync(): Sync { + if (!$this->_sync) { + $this->_sync = new Sync($this); + } + return $this->_sync; + } + /** + * Access the Taskrouter Twilio Domain + * + * @return Taskrouter Taskrouter Twilio Domain + */ + protected function getTaskrouter(): Taskrouter { + if (!$this->_taskrouter) { + $this->_taskrouter = new Taskrouter($this); + } + return $this->_taskrouter; + } + /** + * Access the Trunking Twilio Domain + * + * @return Trunking Trunking Twilio Domain + */ + protected function getTrunking(): Trunking { + if (!$this->_trunking) { + $this->_trunking = new Trunking($this); + } + return $this->_trunking; + } + /** + * Access the Trusthub Twilio Domain + * + * @return Trusthub Trusthub Twilio Domain + */ + protected function getTrusthub(): Trusthub { + if (!$this->_trusthub) { + $this->_trusthub = new Trusthub($this); + } + return $this->_trusthub; + } + /** + * Access the Verify Twilio Domain + * + * @return Verify Verify Twilio Domain + */ + protected function getVerify(): Verify { + if (!$this->_verify) { + $this->_verify = new Verify($this); + } + return $this->_verify; + } + /** + * Access the Video Twilio Domain + * + * @return Video Video Twilio Domain + */ + protected function getVideo(): Video { + if (!$this->_video) { + $this->_video = new Video($this); + } + return $this->_video; + } + /** + * Access the Voice Twilio Domain + * + * @return Voice Voice Twilio Domain + */ + protected function getVoice(): Voice { + if (!$this->_voice) { + $this->_voice = new Voice($this); + } + return $this->_voice; + } + /** + * Access the Wireless Twilio Domain + * + * @return Wireless Wireless Twilio Domain + */ + protected function getWireless(): Wireless { + if (!$this->_wireless) { + $this->_wireless = new Wireless($this); + } + return $this->_wireless; + } + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { + return $this->api->v2010->account->addresses; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to fetch. + */ + protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { + return $this->api->v2010->account->addresses($sid); + } + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { + return $this->api->v2010->account->applications; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to fetch. + */ + protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { + return $this->api->v2010->account->applications($sid); + } + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { + return $this->api->v2010->account->authorizedConnectApps; + } + /** + * @param string $connectAppSid The SID of the Connect App to fetch. + */ + protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { + return $this->api->v2010->account->authorizedConnectApps($connectAppSid); + } + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { + return $this->api->v2010->account->availablePhoneNumbers; + } + /** + * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. + */ + protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { + return $this->api->v2010->account->availablePhoneNumbers($countryCode); + } + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { + return $this->api->v2010->account->balance; + } + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { + return $this->api->v2010->account->calls; + } + /** + * @param string $sid The SID of the Call resource to fetch. + */ + protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { + return $this->api->v2010->account->calls($sid); + } + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { + return $this->api->v2010->account->conferences; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch + */ + protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { + return $this->api->v2010->account->conferences($sid); + } + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { + return $this->api->v2010->account->connectApps; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. + */ + protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { + return $this->api->v2010->account->connectApps($sid); + } + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { + return $this->api->v2010->account->incomingPhoneNumbers; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch. + */ + protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { + return $this->api->v2010->account->incomingPhoneNumbers($sid); + } + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { + return $this->api->v2010->account->keys; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to fetch. + */ + protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { + return $this->api->v2010->account->keys($sid); + } + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { + return $this->api->v2010->account->messages; + } + /** + * @param string $sid The SID of the Message resource to be fetched + */ + protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { + return $this->api->v2010->account->messages($sid); + } + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { + return $this->api->v2010->account->newKeys; + } + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { + return $this->api->v2010->account->newSigningKeys; + } + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { + return $this->api->v2010->account->notifications; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. + */ + protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { + return $this->api->v2010->account->notifications($sid); + } + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { + return $this->api->v2010->account->outgoingCallerIds; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to fetch. + */ + protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { + return $this->api->v2010->account->outgoingCallerIds($sid); + } + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { + return $this->api->v2010->account->queues; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to fetch + */ + protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { + return $this->api->v2010->account->queues($sid); + } + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { + return $this->api->v2010->account->recordings; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to fetch. + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { + return $this->api->v2010->account->recordings($sid); + } + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { + return $this->api->v2010->account->shortCodes; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch + */ + protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { + return $this->api->v2010->account->shortCodes($sid); + } + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { + return $this->api->v2010->account->signingKeys; + } + /** + * @param string $sid The sid + */ + protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { + return $this->api->v2010->account->signingKeys($sid); + } + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { + return $this->api->v2010->account->sip; + } + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { + return $this->api->v2010->account->tokens; + } + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { + return $this->api->v2010->account->transcriptions; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to fetch. + */ + protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { + return $this->api->v2010->account->transcriptions($sid); + } + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { + return $this->api->v2010->account->usage; + } + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { + return $this->api->v2010->account->validationRequests; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content.php b/vendor/twilio/sdk/src/Twilio/Rest/Content.php new file mode 100644 index 0000000..3915e95 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content.php @@ -0,0 +1,25 @@ +contents instead. + */ + protected function getContents(): \Twilio\Rest\Content\V1\ContentList { + echo "contents is deprecated. Use v1->contents instead."; + return $this->v1->contents; + } + + /** + * @deprecated Use v1->contents(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextContents(string $sid): \Twilio\Rest\Content\V1\ContentContext { + echo "contents(\$sid) is deprecated. Use v1->contents(\$sid) instead."; + return $this->v1->contents($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1.php new file mode 100644 index 0000000..c6a84c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1.php @@ -0,0 +1,117 @@ +version = 'v1'; + } + + protected function getContents(): ContentList + { + if (!$this->_contents) { + $this->_contents = new ContentList($this); + } + return $this->_contents; + } + + protected function getContentAndApprovals(): ContentAndApprovalsList + { + if (!$this->_contentAndApprovals) { + $this->_contentAndApprovals = new ContentAndApprovalsList($this); + } + return $this->_contentAndApprovals; + } + + protected function getLegacyContents(): LegacyContentList + { + if (!$this->_legacyContents) { + $this->_legacyContents = new LegacyContentList($this); + } + return $this->_legacyContents; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Content.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php new file mode 100644 index 0000000..5d58539 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php @@ -0,0 +1,91 @@ +properties = [ + 'name' => Values::array_get($payload, 'name'), + 'category' => Values::array_get($payload, 'category'), + 'contentType' => Values::array_get($payload, 'content_type'), + 'status' => Values::array_get($payload, 'status'), + 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), + 'allowCategoryChange' => Values::array_get($payload, 'allow_category_change'), + ]; + + $this->solution = ['contentSid' => $contentSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php new file mode 100644 index 0000000..3478153 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php @@ -0,0 +1,82 @@ +solution = [ + 'contentSid' => + $contentSid, + + ]; + + $this->uri = '/Content/' . \rawurlencode($contentSid) + .'/ApprovalRequests/whatsapp'; + } + + /** + * Create the ApprovalCreateInstance + * + * @param ContentApprovalRequest $contentApprovalRequest + * @return ApprovalCreateInstance Created ApprovalCreateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(ContentApprovalRequest $contentApprovalRequest): ApprovalCreateInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $contentApprovalRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ApprovalCreateInstance( + $this->version, + $payload, + $this->solution['contentSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php new file mode 100644 index 0000000..c1581bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php @@ -0,0 +1,58 @@ +name = Values::array_get($payload, 'name'); + $this->category = Values::array_get($payload, 'category'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'name' => $this->name, + 'category' => $this->category + ]; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php new file mode 100644 index 0000000..2e90854 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApprovalCreateInstance \Twilio\Rest\Content\V1\Content\ApprovalCreateInstance + */ + public function buildInstance(array $payload): ApprovalCreateInstance + { + return new ApprovalCreateInstance($this->version, $payload, $this->solution['contentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php new file mode 100644 index 0000000..b8828ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php @@ -0,0 +1,83 @@ +solution = [ + 'contentSid' => + $contentSid, + ]; + + $this->uri = '/Content/' . \rawurlencode($contentSid) + .'/ApprovalRequests'; + } + + /** + * Fetch the ApprovalFetchInstance + * + * @return ApprovalFetchInstance Fetched ApprovalFetchInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApprovalFetchInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ApprovalFetchInstance( + $this->version, + $payload, + $this->solution['contentSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ApprovalFetchContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php new file mode 100644 index 0000000..44a96fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'whatsapp' => Values::array_get($payload, 'whatsapp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['contentSid' => $contentSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ApprovalFetchContext Context for this ApprovalFetchInstance + */ + protected function proxy(): ApprovalFetchContext + { + if (!$this->context) { + $this->context = new ApprovalFetchContext( + $this->version, + $this->solution['contentSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ApprovalFetchInstance + * + * @return ApprovalFetchInstance Fetched ApprovalFetchInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApprovalFetchInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ApprovalFetchInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php new file mode 100644 index 0000000..35301ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php @@ -0,0 +1,67 @@ +solution = [ + 'contentSid' => + $contentSid, + + ]; + } + + /** + * Constructs a ApprovalFetchContext + */ + public function getContext( + + ): ApprovalFetchContext + { + return new ApprovalFetchContext( + $this->version, + $this->solution['contentSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalFetchList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php new file mode 100644 index 0000000..1bc0791 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApprovalFetchInstance \Twilio\Rest\Content\V1\Content\ApprovalFetchInstance + */ + public function buildInstance(array $payload): ApprovalFetchInstance + { + return new ApprovalFetchInstance($this->version, $payload, $this->solution['contentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalFetchPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php new file mode 100644 index 0000000..d56b5ce --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'approvalRequests' => Values::array_get($payload, 'approval_requests'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsList.php new file mode 100644 index 0000000..3e4457b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsList.php @@ -0,0 +1,145 @@ +solution = [ + ]; + + $this->uri = '/ContentAndApprovals'; + } + + /** + * Reads ContentAndApprovalsInstance 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 ContentAndApprovalsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ContentAndApprovalsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentAndApprovalsInstance 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 ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentAndApprovalsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentAndApprovalsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function getPage(string $targetUrl): ContentAndApprovalsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php new file mode 100644 index 0000000..7a58549 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentAndApprovalsInstance \Twilio\Rest\Content\V1\ContentAndApprovalsInstance + */ + public function buildInstance(array $payload): ContentAndApprovalsInstance + { + return new ContentAndApprovalsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentContext.php new file mode 100644 index 0000000..4a01543 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentContext.php @@ -0,0 +1,173 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Content/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ContentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ContentInstance + * + * @return ContentInstance Fetched ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ContentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ContentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the approvalCreate + */ + protected function getApprovalCreate(): ApprovalCreateList + { + if (!$this->_approvalCreate) { + $this->_approvalCreate = new ApprovalCreateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_approvalCreate; + } + + /** + * Access the approvalFetch + */ + protected function getApprovalFetch(): ApprovalFetchList + { + if (!$this->_approvalFetch) { + $this->_approvalFetch = new ApprovalFetchList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_approvalFetch; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ContentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentInstance.php new file mode 100644 index 0000000..166c9b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ContentContext Context for this ContentInstance + */ + protected function proxy(): ContentContext + { + if (!$this->context) { + $this->context = new ContentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ContentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ContentInstance + * + * @return ContentInstance Fetched ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ContentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the approvalCreate + */ + protected function getApprovalCreate(): ApprovalCreateList + { + return $this->proxy()->approvalCreate; + } + + /** + * Access the approvalFetch + */ + protected function getApprovalFetch(): ApprovalFetchList + { + return $this->proxy()->approvalFetch; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ContentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentList.php new file mode 100644 index 0000000..deb46ed --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentList.php @@ -0,0 +1,184 @@ +solution = [ + ]; + + $this->uri = '/Content'; + } + + /** + * Create the ContentInstance + * + * @param ContentCreateRequest $contentCreateRequest + * @return ContentInstance Created ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(ContentCreateRequest $contentCreateRequest): ContentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $contentCreateRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ContentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ContentInstance 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 ContentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ContentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentInstance 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 ContentPage Page of ContentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentPage Page of ContentInstance + */ + public function getPage(string $targetUrl): ContentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ContentContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. + */ + public function getContext( + string $sid + + ): ContentContext + { + return new ContentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentModels.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentModels.php new file mode 100644 index 0000000..eee21de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentModels.php @@ -0,0 +1,835 @@ + $variables Key value pairs of variable name to value + * @property string $language Language code for the content + * @property Types $types + */ + public static function createContentCreateRequest(array $payload = []): ContentCreateRequest + { + return new ContentCreateRequest($payload); + } + +} + +class TwilioText implements \JsonSerializable +{ + /** + * @property string $body + */ + protected $body; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body + ]; + } +} + +class TwilioMedia implements \JsonSerializable +{ + /** + * @property string $body + * @property string[] $media + */ + protected $body; + protected $media; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->media = Values::array_get($payload, 'media'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'media' => $this->media + ]; + } +} + +class TwilioLocation implements \JsonSerializable +{ + /** + * @property string $latitude + * @property string $longitude + * @property string $label + */ + protected $latitude; + protected $longitude; + protected $label; + public function __construct(array $payload = []) { + $this->latitude = Values::array_get($payload, 'latitude'); + $this->longitude = Values::array_get($payload, 'longitude'); + $this->label = Values::array_get($payload, 'label'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'latitude' => $this->latitude, + 'longitude' => $this->longitude, + 'label' => $this->label + ]; + } +} + +class ListItem implements \JsonSerializable +{ + /** + * @property string $id + * @property string $item + * @property string $description + */ + protected $id; + protected $item; + protected $description; + public function __construct(array $payload = []) { + $this->id = Values::array_get($payload, 'id'); + $this->item = Values::array_get($payload, 'item'); + $this->description = Values::array_get($payload, 'description'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'id' => $this->id, + 'item' => $this->item, + 'description' => $this->description + ]; + } +} + +class TwilioListPicker implements \JsonSerializable +{ + /** + * @property string $body + * @property string $button + * @property ListItem[] $items + */ + protected $body; + protected $button; + protected $items; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->button = Values::array_get($payload, 'button'); + $this->items = Values::array_get($payload, 'items'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'button' => $this->button, + 'items' => $this->items + ]; + } +} + +class CallToActionAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $url + * @property string $phone + * @property string $id + */ + protected $type; + protected $title; + protected $url; + protected $phone; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->url = Values::array_get($payload, 'url'); + $this->phone = Values::array_get($payload, 'phone'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'url' => $this->url, + 'phone' => $this->phone, + 'id' => $this->id + ]; + } +} + +class TwilioCallToAction implements \JsonSerializable +{ + /** + * @property string $body + * @property CallToActionAction[] $actions + */ + protected $body; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'actions' => $this->actions + ]; + } +} + +class QuickReplyAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $id + */ + protected $type; + protected $title; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'id' => $this->id + ]; + } +} + +class TwilioQuickReply implements \JsonSerializable +{ + /** + * @property string $body + * @property QuickReplyAction[] $actions + */ + protected $body; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'actions' => $this->actions + ]; + } +} + +class CardAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $url + * @property string $phone + * @property string $id + */ + protected $type; + protected $title; + protected $url; + protected $phone; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->url = Values::array_get($payload, 'url'); + $this->phone = Values::array_get($payload, 'phone'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'url' => $this->url, + 'phone' => $this->phone, + 'id' => $this->id + ]; + } +} + +class TwilioCard implements \JsonSerializable +{ + /** + * @property string $title + * @property string $subtitle + * @property string[] $media + * @property CardAction[] $actions + */ + protected $title; + protected $subtitle; + protected $media; + protected $actions; + public function __construct(array $payload = []) { + $this->title = Values::array_get($payload, 'title'); + $this->subtitle = Values::array_get($payload, 'subtitle'); + $this->media = Values::array_get($payload, 'media'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'title' => $this->title, + 'subtitle' => $this->subtitle, + 'media' => $this->media, + 'actions' => $this->actions + ]; + } +} + +class CatalogItem implements \JsonSerializable +{ + /** + * @property string $id + * @property string $sectionTitle + * @property string $name + * @property string $mediaUrl + * @property string $price + * @property string $description + */ + protected $id; + protected $sectionTitle; + protected $name; + protected $mediaUrl; + protected $price; + protected $description; + public function __construct(array $payload = []) { + $this->id = Values::array_get($payload, 'id'); + $this->sectionTitle = Values::array_get($payload, 'sectionTitle'); + $this->name = Values::array_get($payload, 'name'); + $this->mediaUrl = Values::array_get($payload, 'mediaUrl'); + $this->price = Values::array_get($payload, 'price'); + $this->description = Values::array_get($payload, 'description'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'id' => $this->id, + 'sectionTitle' => $this->sectionTitle, + 'name' => $this->name, + 'mediaUrl' => $this->mediaUrl, + 'price' => $this->price, + 'description' => $this->description + ]; + } +} + +class TwilioCatalog implements \JsonSerializable +{ + /** + * @property string $title + * @property string $body + * @property string $subtitle + * @property string $id + * @property CatalogItem[] $items + * @property string $dynamicItems + */ + protected $title; + protected $body; + protected $subtitle; + protected $id; + protected $items; + protected $dynamicItems; + public function __construct(array $payload = []) { + $this->title = Values::array_get($payload, 'title'); + $this->body = Values::array_get($payload, 'body'); + $this->subtitle = Values::array_get($payload, 'subtitle'); + $this->id = Values::array_get($payload, 'id'); + $this->items = Values::array_get($payload, 'items'); + $this->dynamicItems = Values::array_get($payload, 'dynamicItems'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'title' => $this->title, + 'body' => $this->body, + 'subtitle' => $this->subtitle, + 'id' => $this->id, + 'items' => $this->items, + 'dynamicItems' => $this->dynamicItems + ]; + } +} + +class WhatsappCard implements \JsonSerializable +{ + /** + * @property string $body + * @property string $footer + * @property string[] $media + * @property string $headerText + * @property CardAction[] $actions + */ + protected $body; + protected $footer; + protected $media; + protected $headerText; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->footer = Values::array_get($payload, 'footer'); + $this->media = Values::array_get($payload, 'media'); + $this->headerText = Values::array_get($payload, 'headerText'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'footer' => $this->footer, + 'media' => $this->media, + 'headerText' => $this->headerText, + 'actions' => $this->actions + ]; + } +} + +class AuthenticationAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $copyCodeText + */ + protected $type; + protected $copyCodeText; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->copyCodeText = Values::array_get($payload, 'copyCodeText'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'copyCodeText' => $this->copyCodeText + ]; + } +} + +class WhatsappAuthentication implements \JsonSerializable +{ + /** + * @property bool $addSecurityRecommendation + * @property string $codeExpirationMinutes + * @property AuthenticationAction[] $actions + */ + protected $addSecurityRecommendation; + protected $codeExpirationMinutes; + protected $actions; + public function __construct(array $payload = []) { + $this->addSecurityRecommendation = Values::array_get($payload, 'addSecurityRecommendation'); + $this->codeExpirationMinutes = Values::array_get($payload, 'codeExpirationMinutes'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'addSecurityRecommendation' => $this->addSecurityRecommendation, + 'codeExpirationMinutes' => $this->codeExpirationMinutes, + 'actions' => $this->actions + ]; + } +} + +class Types implements \JsonSerializable +{ + /** + * @property TwilioText $twilioText + * @property TwilioMedia $twilioMedia + * @property TwilioLocation $twilioLocation + * @property TwilioListPicker $twilioListPicker + * @property TwilioCallToAction $twilioCallToAction + * @property TwilioQuickReply $twilioQuickReply + * @property TwilioCard $twilioCard + * @property TwilioCatalog $twilioCatalog + * @property WhatsappCard $whatsappCard + * @property WhatsappAuthentication $whatsappAuthentication + */ + protected $twilioText; + protected $twilioMedia; + protected $twilioLocation; + protected $twilioListPicker; + protected $twilioCallToAction; + protected $twilioQuickReply; + protected $twilioCard; + protected $twilioCatalog; + protected $whatsappCard; + protected $whatsappAuthentication; + public function __construct(array $payload = []) { + $this->twilioText = Values::array_get($payload, 'twilioText'); + $this->twilioMedia = Values::array_get($payload, 'twilioMedia'); + $this->twilioLocation = Values::array_get($payload, 'twilioLocation'); + $this->twilioListPicker = Values::array_get($payload, 'twilioListPicker'); + $this->twilioCallToAction = Values::array_get($payload, 'twilioCallToAction'); + $this->twilioQuickReply = Values::array_get($payload, 'twilioQuickReply'); + $this->twilioCard = Values::array_get($payload, 'twilioCard'); + $this->twilioCatalog = Values::array_get($payload, 'twilioCatalog'); + $this->whatsappCard = Values::array_get($payload, 'whatsappCard'); + $this->whatsappAuthentication = Values::array_get($payload, 'whatsappAuthentication'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'twilioText' => $this->twilioText, + 'twilioMedia' => $this->twilioMedia, + 'twilioLocation' => $this->twilioLocation, + 'twilioListPicker' => $this->twilioListPicker, + 'twilioCallToAction' => $this->twilioCallToAction, + 'twilioQuickReply' => $this->twilioQuickReply, + 'twilioCard' => $this->twilioCard, + 'twilioCatalog' => $this->twilioCatalog, + 'whatsappCard' => $this->whatsappCard, + 'whatsappAuthentication' => $this->whatsappAuthentication + ]; + } +} + +class ContentCreateRequest implements \JsonSerializable +{ + /** + * @property string $friendlyName User defined name of the content + * @property array $variables Key value pairs of variable name to value + * @property string $language Language code for the content + * @property Types $types + */ + protected $friendlyName; + protected $variables; + protected $language; + protected $types; + public function __construct(array $payload = []) { + $this->friendlyName = Values::array_get($payload, 'friendlyName'); + $this->variables = Values::array_get($payload, 'variables'); + $this->language = Values::array_get($payload, 'language'); + $this->types = Values::array_get($payload, 'types'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'friendlyName' => $this->friendlyName, + 'variables' => $this->variables, + 'language' => $this->language, + 'types' => $this->types + ]; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentPage.php new file mode 100644 index 0000000..0e0df03 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/ContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentInstance \Twilio\Rest\Content\V1\ContentInstance + */ + public function buildInstance(array $payload): ContentInstance + { + return new ContentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentInstance.php new file mode 100644 index 0000000..3188113 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'legacyTemplateName' => Values::array_get($payload, 'legacy_template_name'), + 'legacyBody' => Values::array_get($payload, 'legacy_body'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentList.php new file mode 100644 index 0000000..33b3891 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentList.php @@ -0,0 +1,145 @@ +solution = [ + ]; + + $this->uri = '/LegacyContent'; + } + + /** + * Reads LegacyContentInstance 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 LegacyContentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams LegacyContentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LegacyContentInstance 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 LegacyContentPage Page of LegacyContentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LegacyContentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LegacyContentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LegacyContentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LegacyContentPage Page of LegacyContentInstance + */ + public function getPage(string $targetUrl): LegacyContentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LegacyContentPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentPage.php new file mode 100644 index 0000000..39af7dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V1/LegacyContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LegacyContentInstance \Twilio\Rest\Content\V1\LegacyContentInstance + */ + public function buildInstance(array $payload): LegacyContentInstance + { + return new LegacyContentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2.php new file mode 100644 index 0000000..671b9e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2.php @@ -0,0 +1,105 @@ +version = 'v2'; + } + + protected function getContents(): ContentList + { + if (!$this->_contents) { + $this->_contents = new ContentList($this); + } + return $this->_contents; + } + + protected function getContentAndApprovals(): ContentAndApprovalsList + { + if (!$this->_contentAndApprovals) { + $this->_contentAndApprovals = new ContentAndApprovalsList($this); + } + return $this->_contentAndApprovals; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Content.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsInstance.php new file mode 100644 index 0000000..006efda --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'approvalRequests' => Values::array_get($payload, 'approval_requests'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentAndApprovalsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsList.php new file mode 100644 index 0000000..8ad9e32 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsList.php @@ -0,0 +1,169 @@ +solution = [ + ]; + + $this->uri = '/ContentAndApprovals'; + } + + /** + * Reads ContentAndApprovalsInstance 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 ContentAndApprovalsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ContentAndApprovalsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentAndApprovalsInstance 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 ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentAndApprovalsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SortByDate' => + $options['sortByDate'], + 'SortByContentName' => + $options['sortByContentName'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'ContentName' => + $options['contentName'], + 'Content' => + $options['content'], + 'Language' => + Serialize::map($options['language'], function ($e) { return $e; }), + 'ContentType' => + Serialize::map($options['contentType'], function ($e) { return $e; }), + 'ChannelEligibility' => + Serialize::map($options['channelEligibility'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentAndApprovalsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function getPage(string $targetUrl): ContentAndApprovalsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentAndApprovalsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsOptions.php new file mode 100644 index 0000000..80f619e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsOptions.php @@ -0,0 +1,220 @@ +=[date-time] + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @param string $contentName Filter by Regex Pattern in content name + * @param string $content Filter by Regex Pattern in template content + * @param string[] $language Filter by array of valid language(s) + * @param string[] $contentType Filter by array of contentType(s) + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * @return ReadContentAndApprovalsOptions Options builder + */ + public static function read( + + string $sortByDate = Values::NONE, + string $sortByContentName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $contentName = Values::NONE, + string $content = Values::NONE, + array $language = Values::ARRAY_NONE, + array $contentType = Values::ARRAY_NONE, + array $channelEligibility = Values::ARRAY_NONE + + ): ReadContentAndApprovalsOptions + { + return new ReadContentAndApprovalsOptions( + $sortByDate, + $sortByContentName, + $dateCreatedAfter, + $dateCreatedBefore, + $contentName, + $content, + $language, + $contentType, + $channelEligibility + ); + } + +} + +class ReadContentAndApprovalsOptions extends Options + { + /** + * @param string $sortByDate Whether to sort by ascending or descending date updated + * @param string $sortByContentName Whether to sort by ascending or descending content name + * @param \DateTime $dateCreatedAfter Filter by >=[date-time] + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @param string $contentName Filter by Regex Pattern in content name + * @param string $content Filter by Regex Pattern in template content + * @param string[] $language Filter by array of valid language(s) + * @param string[] $contentType Filter by array of contentType(s) + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + */ + public function __construct( + + string $sortByDate = Values::NONE, + string $sortByContentName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $contentName = Values::NONE, + string $content = Values::NONE, + array $language = Values::ARRAY_NONE, + array $contentType = Values::ARRAY_NONE, + array $channelEligibility = Values::ARRAY_NONE + + ) { + $this->options['sortByDate'] = $sortByDate; + $this->options['sortByContentName'] = $sortByContentName; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['contentName'] = $contentName; + $this->options['content'] = $content; + $this->options['language'] = $language; + $this->options['contentType'] = $contentType; + $this->options['channelEligibility'] = $channelEligibility; + } + + /** + * Whether to sort by ascending or descending date updated + * + * @param string $sortByDate Whether to sort by ascending or descending date updated + * @return $this Fluent Builder + */ + public function setSortByDate(string $sortByDate): self + { + $this->options['sortByDate'] = $sortByDate; + return $this; + } + + /** + * Whether to sort by ascending or descending content name + * + * @param string $sortByContentName Whether to sort by ascending or descending content name + * @return $this Fluent Builder + */ + public function setSortByContentName(string $sortByContentName): self + { + $this->options['sortByContentName'] = $sortByContentName; + return $this; + } + + /** + * Filter by >=[date-time] + * + * @param \DateTime $dateCreatedAfter Filter by >=[date-time] + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Filter by <=[date-time] + * + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Filter by Regex Pattern in content name + * + * @param string $contentName Filter by Regex Pattern in content name + * @return $this Fluent Builder + */ + public function setContentName(string $contentName): self + { + $this->options['contentName'] = $contentName; + return $this; + } + + /** + * Filter by Regex Pattern in template content + * + * @param string $content Filter by Regex Pattern in template content + * @return $this Fluent Builder + */ + public function setContent(string $content): self + { + $this->options['content'] = $content; + return $this; + } + + /** + * Filter by array of valid language(s) + * + * @param string[] $language Filter by array of valid language(s) + * @return $this Fluent Builder + */ + public function setLanguage(array $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Filter by array of contentType(s) + * + * @param string[] $contentType Filter by array of contentType(s) + * @return $this Fluent Builder + */ + public function setContentType(array $contentType): self + { + $this->options['contentType'] = $contentType; + return $this; + } + + /** + * Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * @return $this Fluent Builder + */ + public function setChannelEligibility(array $channelEligibility): self + { + $this->options['channelEligibility'] = $channelEligibility; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Content.V2.ReadContentAndApprovalsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsPage.php new file mode 100644 index 0000000..ec0a464 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentAndApprovalsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentAndApprovalsInstance \Twilio\Rest\Content\V2\ContentAndApprovalsInstance + */ + public function buildInstance(array $payload): ContentAndApprovalsInstance + { + return new ContentAndApprovalsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentAndApprovalsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentInstance.php new file mode 100644 index 0000000..4a4333a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentInstance.php @@ -0,0 +1,99 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentList.php new file mode 100644 index 0000000..1b7220f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentList.php @@ -0,0 +1,169 @@ +solution = [ + ]; + + $this->uri = '/Content'; + } + + /** + * Reads ContentInstance 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 ContentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ContentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentInstance 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 ContentPage Page of ContentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentPage + { + $options = new Values($options); + + $params = Values::of([ + 'SortByDate' => + $options['sortByDate'], + 'SortByContentName' => + $options['sortByContentName'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'ContentName' => + $options['contentName'], + 'Content' => + $options['content'], + 'Language' => + Serialize::map($options['language'], function ($e) { return $e; }), + 'ContentType' => + Serialize::map($options['contentType'], function ($e) { return $e; }), + 'ChannelEligibility' => + Serialize::map($options['channelEligibility'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentPage Page of ContentInstance + */ + public function getPage(string $targetUrl): ContentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentOptions.php new file mode 100644 index 0000000..a47a4d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentOptions.php @@ -0,0 +1,220 @@ +=[date-time] + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @param string $contentName Filter by Regex Pattern in content name + * @param string $content Filter by Regex Pattern in template content + * @param string[] $language Filter by array of valid language(s) + * @param string[] $contentType Filter by array of contentType(s) + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * @return ReadContentOptions Options builder + */ + public static function read( + + string $sortByDate = Values::NONE, + string $sortByContentName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $contentName = Values::NONE, + string $content = Values::NONE, + array $language = Values::ARRAY_NONE, + array $contentType = Values::ARRAY_NONE, + array $channelEligibility = Values::ARRAY_NONE + + ): ReadContentOptions + { + return new ReadContentOptions( + $sortByDate, + $sortByContentName, + $dateCreatedAfter, + $dateCreatedBefore, + $contentName, + $content, + $language, + $contentType, + $channelEligibility + ); + } + +} + +class ReadContentOptions extends Options + { + /** + * @param string $sortByDate Whether to sort by ascending or descending date updated + * @param string $sortByContentName Whether to sort by ascending or descending content name + * @param \DateTime $dateCreatedAfter Filter by >=[date-time] + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @param string $contentName Filter by Regex Pattern in content name + * @param string $content Filter by Regex Pattern in template content + * @param string[] $language Filter by array of valid language(s) + * @param string[] $contentType Filter by array of contentType(s) + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + */ + public function __construct( + + string $sortByDate = Values::NONE, + string $sortByContentName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $contentName = Values::NONE, + string $content = Values::NONE, + array $language = Values::ARRAY_NONE, + array $contentType = Values::ARRAY_NONE, + array $channelEligibility = Values::ARRAY_NONE + + ) { + $this->options['sortByDate'] = $sortByDate; + $this->options['sortByContentName'] = $sortByContentName; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['contentName'] = $contentName; + $this->options['content'] = $content; + $this->options['language'] = $language; + $this->options['contentType'] = $contentType; + $this->options['channelEligibility'] = $channelEligibility; + } + + /** + * Whether to sort by ascending or descending date updated + * + * @param string $sortByDate Whether to sort by ascending or descending date updated + * @return $this Fluent Builder + */ + public function setSortByDate(string $sortByDate): self + { + $this->options['sortByDate'] = $sortByDate; + return $this; + } + + /** + * Whether to sort by ascending or descending content name + * + * @param string $sortByContentName Whether to sort by ascending or descending content name + * @return $this Fluent Builder + */ + public function setSortByContentName(string $sortByContentName): self + { + $this->options['sortByContentName'] = $sortByContentName; + return $this; + } + + /** + * Filter by >=[date-time] + * + * @param \DateTime $dateCreatedAfter Filter by >=[date-time] + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Filter by <=[date-time] + * + * @param \DateTime $dateCreatedBefore Filter by <=[date-time] + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Filter by Regex Pattern in content name + * + * @param string $contentName Filter by Regex Pattern in content name + * @return $this Fluent Builder + */ + public function setContentName(string $contentName): self + { + $this->options['contentName'] = $contentName; + return $this; + } + + /** + * Filter by Regex Pattern in template content + * + * @param string $content Filter by Regex Pattern in template content + * @return $this Fluent Builder + */ + public function setContent(string $content): self + { + $this->options['content'] = $content; + return $this; + } + + /** + * Filter by array of valid language(s) + * + * @param string[] $language Filter by array of valid language(s) + * @return $this Fluent Builder + */ + public function setLanguage(array $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Filter by array of contentType(s) + * + * @param string[] $contentType Filter by array of contentType(s) + * @return $this Fluent Builder + */ + public function setContentType(array $contentType): self + { + $this->options['contentType'] = $contentType; + return $this; + } + + /** + * Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * + * @param string[] $channelEligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=: + * @return $this Fluent Builder + */ + public function setChannelEligibility(array $channelEligibility): self + { + $this->options['channelEligibility'] = $channelEligibility; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Content.V2.ReadContentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentPage.php new file mode 100644 index 0000000..131dff6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Content/V2/ContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentInstance \Twilio\Rest\Content\V2\ContentInstance + */ + public function buildInstance(array $payload): ContentInstance + { + return new ContentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V2.ContentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ContentBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ContentBase.php new file mode 100644 index 0000000..670846e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ContentBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://content.twilio.com'; + } + + + /** + * @return V1 Version v1 of content + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of content + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Content]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations.php new file mode 100644 index 0000000..09fa76c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations.php @@ -0,0 +1,137 @@ +configuration instead. + */ + protected function getConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationList { + echo "configuration is deprecated. Use v1->configuration instead."; + return $this->v1->configuration; + } + + /** + * @deprecated Use v1->configuration() instead. + */ + protected function contextConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationContext { + echo "configuration() is deprecated. Use v1->configuration() instead."; + return $this->v1->configuration(); + } + + /** + * @deprecated Use v1->addressConfigurations instead. + */ + protected function getAddressConfigurations(): \Twilio\Rest\Conversations\V1\AddressConfigurationList { + echo "addressConfigurations is deprecated. Use v1->addressConfigurations instead."; + return $this->v1->addressConfigurations; + } + + /** + * @deprecated Use v1->addressConfigurations(\$sid) instead. + * @param string $sid The SID or Address of the Configuration. + */ + protected function contextAddressConfigurations(string $sid): \Twilio\Rest\Conversations\V1\AddressConfigurationContext { + echo "addressConfigurations(\$sid) is deprecated. Use v1->addressConfigurations(\$sid) instead."; + return $this->v1->addressConfigurations($sid); + } + + /** + * @deprecated Use v1->conversations instead. + */ + protected function getConversations(): \Twilio\Rest\Conversations\V1\ConversationList { + echo "conversations is deprecated. Use v1->conversations instead."; + return $this->v1->conversations; + } + + /** + * @deprecated Use v1->conversations(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextConversations(string $sid): \Twilio\Rest\Conversations\V1\ConversationContext { + echo "conversations(\$sid) is deprecated. Use v1->conversations(\$sid) instead."; + return $this->v1->conversations($sid); + } + + /** + * @deprecated Use v1->credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Conversations\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->credentials(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Conversations\V1\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; + return $this->v1->credentials($sid); + } + + /** + * @deprecated Use v1->participantConversations instead. + */ + protected function getParticipantConversations(): \Twilio\Rest\Conversations\V1\ParticipantConversationList { + echo "participantConversations is deprecated. Use v1->participantConversations instead."; + return $this->v1->participantConversations; + } + + /** + * @deprecated Use v1->roles instead. + */ + protected function getRoles(): \Twilio\Rest\Conversations\V1\RoleList { + echo "roles is deprecated. Use v1->roles instead."; + return $this->v1->roles; + } + + /** + * @deprecated Use v1->roles(\$sid) instead. + * @param string $sid The SID of the Role resource to fetch + */ + protected function contextRoles(string $sid): \Twilio\Rest\Conversations\V1\RoleContext { + echo "roles(\$sid) is deprecated. Use v1->roles(\$sid) instead."; + return $this->v1->roles($sid); + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Conversations\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextServices(string $sid): \Twilio\Rest\Conversations\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } + + /** + * @deprecated Use v1->users instead. + */ + protected function getUsers(): \Twilio\Rest\Conversations\V1\UserList { + echo "users is deprecated. Use v1->users instead."; + return $this->v1->users; + } + + /** + * @deprecated Use v1->users(\$sid) instead. + * @param string $sid The SID of the User resource to fetch + */ + protected function contextUsers(string $sid): \Twilio\Rest\Conversations\V1\UserContext { + echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; + return $this->v1->users($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1.php new file mode 100644 index 0000000..cfb3fd0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1.php @@ -0,0 +1,177 @@ +version = 'v1'; + } + + protected function getAddressConfigurations(): AddressConfigurationList + { + if (!$this->_addressConfigurations) { + $this->_addressConfigurations = new AddressConfigurationList($this); + } + return $this->_addressConfigurations; + } + + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList($this); + } + return $this->_configuration; + } + + protected function getConversations(): ConversationList + { + if (!$this->_conversations) { + $this->_conversations = new ConversationList($this); + } + return $this->_conversations; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getParticipantConversations(): ParticipantConversationList + { + if (!$this->_participantConversations) { + $this->_participantConversations = new ParticipantConversationList($this); + } + return $this->_participantConversations; + } + + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList($this); + } + return $this->_roles; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList($this); + } + return $this->_users; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Conversations.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php new file mode 100644 index 0000000..aa6c9d9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php @@ -0,0 +1,143 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Configuration/Addresses/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AddressConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AddressConfigurationInstance + * + * @return AddressConfigurationInstance Fetched AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AddressConfigurationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AddressConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Updated AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'AutoCreation.Enabled' => + Serialize::booleanToString($options['autoCreationEnabled']), + 'AutoCreation.Type' => + $options['autoCreationType'], + 'AutoCreation.ConversationServiceSid' => + $options['autoCreationConversationServiceSid'], + 'AutoCreation.WebhookUrl' => + $options['autoCreationWebhookUrl'], + 'AutoCreation.WebhookMethod' => + $options['autoCreationWebhookMethod'], + 'AutoCreation.WebhookFilters' => + Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), + 'AutoCreation.StudioFlowSid' => + $options['autoCreationStudioFlowSid'], + 'AutoCreation.StudioRetryCount' => + $options['autoCreationStudioRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AddressConfigurationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.AddressConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php new file mode 100644 index 0000000..2012882 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'type' => Values::array_get($payload, 'type'), + 'address' => Values::array_get($payload, 'address'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'autoCreation' => Values::array_get($payload, 'auto_creation'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'addressCountry' => Values::array_get($payload, 'address_country'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AddressConfigurationContext Context for this AddressConfigurationInstance + */ + protected function proxy(): AddressConfigurationContext + { + if (!$this->context) { + $this->context = new AddressConfigurationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddressConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddressConfigurationInstance + * + * @return AddressConfigurationInstance Fetched AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AddressConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Updated AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressConfigurationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.AddressConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php new file mode 100644 index 0000000..b59974e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php @@ -0,0 +1,221 @@ +solution = [ + ]; + + $this->uri = '/Configuration/Addresses'; + } + + /** + * Create the AddressConfigurationInstance + * + * @param string $type + * @param string $address The unique address to be configured. The address can be a whatsapp address or phone number + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Created AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, string $address, array $options = []): AddressConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Address' => + $address, + 'FriendlyName' => + $options['friendlyName'], + 'AutoCreation.Enabled' => + Serialize::booleanToString($options['autoCreationEnabled']), + 'AutoCreation.Type' => + $options['autoCreationType'], + 'AutoCreation.ConversationServiceSid' => + $options['autoCreationConversationServiceSid'], + 'AutoCreation.WebhookUrl' => + $options['autoCreationWebhookUrl'], + 'AutoCreation.WebhookMethod' => + $options['autoCreationWebhookMethod'], + 'AutoCreation.WebhookFilters' => + Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), + 'AutoCreation.StudioFlowSid' => + $options['autoCreationStudioFlowSid'], + 'AutoCreation.StudioRetryCount' => + $options['autoCreationStudioRetryCount'], + 'AddressCountry' => + $options['addressCountry'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AddressConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AddressConfigurationInstance 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 AddressConfigurationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AddressConfigurationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AddressConfigurationInstance 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 AddressConfigurationPage Page of AddressConfigurationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddressConfigurationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AddressConfigurationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AddressConfigurationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AddressConfigurationPage Page of AddressConfigurationInstance + */ + public function getPage(string $targetUrl): AddressConfigurationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddressConfigurationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddressConfigurationContext + * + * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration + */ + public function getContext( + string $sid + + ): AddressConfigurationContext + { + return new AddressConfigurationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.AddressConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php new file mode 100644 index 0000000..acb92c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php @@ -0,0 +1,482 @@ +options['friendlyName'] = $friendlyName; + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + $this->options['autoCreationType'] = $autoCreationType; + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + $this->options['addressCountry'] = $addressCountry; + } + + /** + * The human-readable name of this configuration, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Enable/Disable auto-creating conversations for messages to this address + * + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @return $this Fluent Builder + */ + public function setAutoCreationEnabled(bool $autoCreationEnabled): self + { + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + return $this; + } + + /** + * @param string $autoCreationType + * @return $this Fluent Builder + */ + public function setAutoCreationType(string $autoCreationType): self + { + $this->options['autoCreationType'] = $autoCreationType; + return $this; + } + + /** + * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @return $this Fluent Builder + */ + public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self + { + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + return $this; + } + + /** + * For type `webhook`, the url for the webhook request. + * + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self + { + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + return $this; + } + + /** + * @param string $autoCreationWebhookMethod + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self + { + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self + { + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + return $this; + } + + /** + * For type `studio`, the studio flow SID where the webhook should be sent to. + * + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self + { + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + return $this; + } + + /** + * For type `studio`, number of times to retry the webhook request + * + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + * @return $this Fluent Builder + */ + public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self + { + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + return $this; + } + + /** + * An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. + * + * @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. + * @return $this Fluent Builder + */ + public function setAddressCountry(string $addressCountry): self + { + $this->options['addressCountry'] = $addressCountry; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateAddressConfigurationOptions ' . $options . ']'; + } +} + + + +class ReadAddressConfigurationOptions extends Options + { + /** + * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + */ + public function __construct( + + string $type = Values::NONE + + ) { + $this->options['type'] = $type; + } + + /** + * Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + * + * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadAddressConfigurationOptions ' . $options . ']'; + } +} + +class UpdateAddressConfigurationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @param string $autoCreationType + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @param string $autoCreationWebhookMethod + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $autoCreationEnabled = Values::BOOL_NONE, + string $autoCreationType = Values::NONE, + string $autoCreationConversationServiceSid = Values::NONE, + string $autoCreationWebhookUrl = Values::NONE, + string $autoCreationWebhookMethod = Values::NONE, + array $autoCreationWebhookFilters = Values::ARRAY_NONE, + string $autoCreationStudioFlowSid = Values::NONE, + int $autoCreationStudioRetryCount = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + $this->options['autoCreationType'] = $autoCreationType; + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + } + + /** + * The human-readable name of this configuration, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Enable/Disable auto-creating conversations for messages to this address + * + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @return $this Fluent Builder + */ + public function setAutoCreationEnabled(bool $autoCreationEnabled): self + { + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + return $this; + } + + /** + * @param string $autoCreationType + * @return $this Fluent Builder + */ + public function setAutoCreationType(string $autoCreationType): self + { + $this->options['autoCreationType'] = $autoCreationType; + return $this; + } + + /** + * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @return $this Fluent Builder + */ + public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self + { + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + return $this; + } + + /** + * For type `webhook`, the url for the webhook request. + * + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self + { + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + return $this; + } + + /** + * @param string $autoCreationWebhookMethod + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self + { + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self + { + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + return $this; + } + + /** + * For type `studio`, the studio flow SID where the webhook should be sent to. + * + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self + { + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + return $this; + } + + /** + * For type `studio`, number of times to retry the webhook request + * + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + * @return $this Fluent Builder + */ + public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self + { + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateAddressConfigurationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php new file mode 100644 index 0000000..d5bae5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddressConfigurationInstance \Twilio\Rest\Conversations\V1\AddressConfigurationInstance + */ + public function buildInstance(array $payload): AddressConfigurationInstance + { + return new AddressConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.AddressConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php new file mode 100644 index 0000000..32e452e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php @@ -0,0 +1,114 @@ +solution = [ + ]; + + $this->uri = '/Configuration/Webhooks'; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Method' => + $options['method'], + 'Filters' => + Serialize::map($options['filters'], function ($e) { return $e; }), + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'Target' => + $options['target'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php new file mode 100644 index 0000000..2820388 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'method' => Values::array_get($payload, 'method'), + 'filters' => Values::array_get($payload, 'filters'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php new file mode 100644 index 0000000..d9a4e42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a WebhookContext + */ + public function getContext( + + ): WebhookContext + { + return new WebhookContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php new file mode 100644 index 0000000..37647ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php @@ -0,0 +1,148 @@ +options['method'] = $method; + $this->options['filters'] = $filters; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['target'] = $target; + } + + /** + * The HTTP method to be used when sending a webhook request. + * + * @param string $method The HTTP method to be used when sending a webhook request. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + * + * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + * @return $this Fluent Builder + */ + public function setFilters(array $filters): self + { + $this->options['filters'] = $filters; + return $this; + } + + /** + * The absolute url the pre-event webhook request should be sent to. + * + * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The absolute url the post-event webhook request should be sent to. + * + * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * @param string $target + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php new file mode 100644 index 0000000..c8114ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Configuration\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php new file mode 100644 index 0000000..b950329 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php @@ -0,0 +1,111 @@ +solution = [ + ]; + + $this->uri = '/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultChatServiceSid' => + $options['defaultChatServiceSid'], + 'DefaultMessagingServiceSid' => + $options['defaultMessagingServiceSid'], + 'DefaultInactiveTimer' => + $options['defaultInactiveTimer'], + 'DefaultClosedTimer' => + $options['defaultClosedTimer'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationInstance.php new file mode 100644 index 0000000..69ef386 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'defaultChatServiceSid' => Values::array_get($payload, 'default_chat_service_sid'), + 'defaultMessagingServiceSid' => Values::array_get($payload, 'default_messaging_service_sid'), + 'defaultInactiveTimer' => Values::array_get($payload, 'default_inactive_timer'), + 'defaultClosedTimer' => Values::array_get($payload, 'default_closed_timer'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationList.php new file mode 100644 index 0000000..46ad589 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationList.php @@ -0,0 +1,118 @@ +solution = [ + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version + ); + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version + ); + } + return $this->_webhooks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Conversations.V1.ConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationOptions.php new file mode 100644 index 0000000..186862e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationOptions.php @@ -0,0 +1,132 @@ +options['defaultChatServiceSid'] = $defaultChatServiceSid; + $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; + $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; + $this->options['defaultClosedTimer'] = $defaultClosedTimer; + } + + /** + * The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. + * + * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. + * @return $this Fluent Builder + */ + public function setDefaultChatServiceSid(string $defaultChatServiceSid): self + { + $this->options['defaultChatServiceSid'] = $defaultChatServiceSid; + return $this; + } + + /** + * The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. + * + * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. + * @return $this Fluent Builder + */ + public function setDefaultMessagingServiceSid(string $defaultMessagingServiceSid): self + { + $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; + return $this; + } + + /** + * Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setDefaultInactiveTimer(string $defaultInactiveTimer): self + { + $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; + return $this; + } + + /** + * Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setDefaultClosedTimer(string $defaultClosedTimer): self + { + $this->options['defaultClosedTimer'] = $defaultClosedTimer; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationPage.php new file mode 100644 index 0000000..483f067 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php new file mode 100644 index 0000000..52b136f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php @@ -0,0 +1,95 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeliveryReceiptInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php new file mode 100644 index 0000000..5526461 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'messageSid' => Values::array_get($payload, 'message_sid'), + 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + '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 = ['conversationSid' => $conversationSid, '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 DeliveryReceiptContext Context for this DeliveryReceiptInstance + */ + protected function proxy(): DeliveryReceiptContext + { + if (!$this->context) { + $this->context = new DeliveryReceiptContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php new file mode 100644 index 0000000..5aaec20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php @@ -0,0 +1,175 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts'; + } + + /** + * Reads DeliveryReceiptInstance 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 DeliveryReceiptInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeliveryReceiptInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeliveryReceiptInstance 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 DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeliveryReceiptPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function getPage(string $targetUrl): DeliveryReceiptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeliveryReceiptContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): DeliveryReceiptContext + { + return new DeliveryReceiptContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php new file mode 100644 index 0000000..a3de36d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptInstance + */ + public function buildInstance(array $payload): DeliveryReceiptInstance + { + return new DeliveryReceiptInstance($this->version, $payload, $this->solution['conversationSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php new file mode 100644 index 0000000..f5e3246 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php @@ -0,0 +1,206 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'Subject' => + $options['subject'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + if (!$this->_deliveryReceipts) { + $this->_deliveryReceipts = new DeliveryReceiptList( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->_deliveryReceipts; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php new file mode 100644 index 0000000..01f1514 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php @@ -0,0 +1,184 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'index' => Values::array_get($payload, 'index'), + 'author' => Values::array_get($payload, 'author'), + 'body' => Values::array_get($payload, 'body'), + 'media' => Values::array_get($payload, 'media'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'delivery' => Values::array_get($payload, 'delivery'), + 'links' => Values::array_get($payload, 'links'), + 'contentSid' => Values::array_get($payload, 'content_sid'), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + return $this->proxy()->deliveryReceipts; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php new file mode 100644 index 0000000..26b15d7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php @@ -0,0 +1,221 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MediaSid' => + $options['mediaSid'], + 'ContentSid' => + $options['contentSid'], + 'ContentVariables' => + $options['contentVariables'], + 'Subject' => + $options['subject'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php new file mode 100644 index 0000000..ca7b06a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php @@ -0,0 +1,504 @@ +options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['mediaSid'] = $mediaSid; + $this->options['contentSid'] = $contentSid; + $this->options['contentVariables'] = $contentVariables; + $this->options['subject'] = $subject; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The Media SID to be attached to the new Message. + * + * @param string $mediaSid The Media SID to be attached to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * + * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * A structurally valid JSON string that contains values to resolve Rich Content template variables. + * + * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * The subject of the message, can be up to 256 characters long. + * + * @param string $subject The subject of the message, can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setSubject(string $subject): self + { + $this->options['subject'] = $subject; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @param string $body The content of the message, can be up to 1,600 characters long. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $subject The subject of the message, can be up to 256 characters long. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $author = Values::NONE, + string $body = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $subject = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['subject'] = $subject; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The subject of the message, can be up to 256 characters long. + * + * @param string $subject The subject of the message, can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setSubject(string $subject): self + { + $this->options['subject'] = $subject; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php new file mode 100644 index 0000000..5e22241 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Conversations\V1\Conversation\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php new file mode 100644 index 0000000..d94b4f4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php @@ -0,0 +1,153 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'Identity' => + $options['identity'], + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + 'LastReadTimestamp' => + $options['lastReadTimestamp'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php new file mode 100644 index 0000000..b50d917 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php new file mode 100644 index 0000000..160bb85 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php @@ -0,0 +1,213 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $options['identity'], + 'MessagingBinding.Address' => + $options['messagingBindingAddress'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + '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 ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php new file mode 100644 index 0000000..fd2693c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php @@ -0,0 +1,490 @@ +options['identity'] = $identity; + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingAddress(string $messagingBindingAddress): self + { + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + return $this; + } + + /** + * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; + } +} + +class DeleteParticipantOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; + } +} + + + +class UpdateParticipantOptions extends Options + { + /** + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $messagingBindingProxyAddress = Values::NONE, + string $messagingBindingProjectedAddress = Values::NONE, + string $identity = Values::NONE, + int $lastReadMessageIndex = Values::INT_NONE, + string $lastReadTimestamp = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['identity'] = $identity; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(string $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php new file mode 100644 index 0000000..883cd17 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Conversation\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php new file mode 100644 index 0000000..5f5ceb4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php @@ -0,0 +1,142 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php new file mode 100644 index 0000000..978b56c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php new file mode 100644 index 0000000..db9ed4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php @@ -0,0 +1,212 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $target + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.ReplayAfter' => + $options['configurationReplayAfter'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php new file mode 100644 index 0000000..1ad0f0f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php @@ -0,0 +1,292 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The message index for which and it's successors the webhook will be replayed. Not set by default + * + * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default + * @return $this Fluent Builder + */ + public function setConfigurationReplayAfter(int $configurationReplayAfter): self + { + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @param string $configurationMethod + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php new file mode 100644 index 0000000..6b54178 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Conversation\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php new file mode 100644 index 0000000..6633ab5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php @@ -0,0 +1,246 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'UniqueName' => + $options['uniqueName'], + 'Bindings.Email.Address' => + $options['bindingsEmailAddress'], + 'Bindings.Email.Name' => + $options['bindingsEmailName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php new file mode 100644 index 0000000..0080222 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php @@ -0,0 +1,200 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'state' => Values::array_get($payload, 'state'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'timers' => Values::array_get($payload, 'timers'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'bindings' => Values::array_get($payload, 'bindings'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConversationContext Context for this ConversationInstance + */ + protected function proxy(): ConversationContext + { + if (!$this->context) { + $this->context = new ConversationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php new file mode 100644 index 0000000..654d165 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php @@ -0,0 +1,221 @@ +solution = [ + ]; + + $this->uri = '/Conversations'; + } + + /** + * Create the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Created ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'Attributes' => + $options['attributes'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'Bindings.Email.Address' => + $options['bindingsEmailAddress'], + 'Bindings.Email.Name' => + $options['bindingsEmailName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param 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 ConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConversationPage Page of ConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'StartDate' => + $options['startDate'], + 'EndDate' => + $options['endDate'], + 'State' => + $options['state'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConversationPage Page of ConversationInstance + */ + public function getPage(string $targetUrl): ConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConversationContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. + */ + public function getContext( + string $sid + + ): ConversationContext + { + return new ConversationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php new file mode 100644 index 0000000..eaf8086 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php @@ -0,0 +1,662 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['attributes'] = $attributes; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + $this->options['bindingsEmailName'] = $bindingsEmailName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * The default email address that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailAddress(string $bindingsEmailAddress): self + { + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + return $this; + } + + /** + * The default name that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailName(string $bindingsEmailName): self + { + $this->options['bindingsEmailName'] = $bindingsEmailName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; + } +} + +class DeleteConversationOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; + } +} + + +class ReadConversationOptions extends Options + { + /** + * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + */ + public function __construct( + + string $startDate = Values::NONE, + string $endDate = Values::NONE, + string $state = Values::NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['state'] = $state; + } + + /** + * Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * + * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @return $this Fluent Builder + */ + public function setStartDate(string $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @return $this Fluent Builder + */ + public function setEndDate(string $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; + } +} + +class UpdateConversationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @param string $state + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $state = Values::NONE, + string $timersInactive = Values::NONE, + string $timersClosed = Values::NONE, + string $uniqueName = Values::NONE, + string $bindingsEmailAddress = Values::NONE, + string $bindingsEmailName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['uniqueName'] = $uniqueName; + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + $this->options['bindingsEmailName'] = $bindingsEmailName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The default email address that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailAddress(string $bindingsEmailAddress): self + { + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + return $this; + } + + /** + * The default name that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailName(string $bindingsEmailName): self + { + $this->options['bindingsEmailName'] = $bindingsEmailName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php new file mode 100644 index 0000000..e4cb786 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConversationInstance \Twilio\Rest\Conversations\V1\ConversationInstance + */ + public function buildInstance(array $payload): ConversationInstance + { + return new ConversationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialContext.php new file mode 100644 index 0000000..3ba21ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialContext.php @@ -0,0 +1,139 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $options['type'], + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialInstance.php new file mode 100644 index 0000000..ba4e332 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialList.php new file mode 100644 index 0000000..0642cab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialOptions.php new file mode 100644 index 0000000..a87d6a5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialOptions.php @@ -0,0 +1,330 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $type + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $type = Values::NONE, + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['type'] = $type; + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialPage.php new file mode 100644 index 0000000..a27ebe4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Conversations\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php new file mode 100644 index 0000000..a3ebc87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php @@ -0,0 +1,111 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), + 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), + 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), + 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), + 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), + 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationList.php new file mode 100644 index 0000000..4b8a648 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/ParticipantConversations'; + } + + /** + * Reads ParticipantConversationInstance 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 ParticipantConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantConversationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantConversationInstance 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 ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + $options['identity'], + 'Address' => + $options['address'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function getPage(string $targetUrl): ParticipantConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php new file mode 100644 index 0000000..3db728e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php @@ -0,0 +1,94 @@ +options['identity'] = $identity; + $this->options['address'] = $address; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * + * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * @return $this Fluent Builder + */ + public function setAddress(string $address): self + { + $this->options['address'] = $address; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php new file mode 100644 index 0000000..1db3d37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\ParticipantConversationInstance + */ + public function buildInstance(array $payload): ParticipantConversationInstance + { + return new ParticipantConversationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleContext.php new file mode 100644 index 0000000..a519a57 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleContext.php @@ -0,0 +1,124 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleInstance.php new file mode 100644 index 0000000..77a2d61 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleInstance.php @@ -0,0 +1,157 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleList.php new file mode 100644 index 0000000..341bc37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RoleList.php @@ -0,0 +1,194 @@ +solution = [ + ]; + + $this->uri = '/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RolePage.php new file mode 100644 index 0000000..9d98c9d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Conversations\V1\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php new file mode 100644 index 0000000..51a9cb9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php @@ -0,0 +1,103 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php new file mode 100644 index 0000000..5b29d37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_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')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingList.php new file mode 100644 index 0000000..c641e50 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Bindings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance 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 BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + '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 BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The SID of the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.BindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingOptions.php new file mode 100644 index 0000000..dd4b854 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. + * + * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingPage.php new file mode 100644 index 0000000..60c555a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Conversations\V1\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.BindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php new file mode 100644 index 0000000..883bd21 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php @@ -0,0 +1,137 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration/Notifications'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Updated NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'NewMessage.Enabled' => + Serialize::booleanToString($options['newMessageEnabled']), + 'NewMessage.Template' => + $options['newMessageTemplate'], + 'NewMessage.Sound' => + $options['newMessageSound'], + 'NewMessage.BadgeCountEnabled' => + Serialize::booleanToString($options['newMessageBadgeCountEnabled']), + 'AddedToConversation.Enabled' => + Serialize::booleanToString($options['addedToConversationEnabled']), + 'AddedToConversation.Template' => + $options['addedToConversationTemplate'], + 'AddedToConversation.Sound' => + $options['addedToConversationSound'], + 'RemovedFromConversation.Enabled' => + Serialize::booleanToString($options['removedFromConversationEnabled']), + 'RemovedFromConversation.Template' => + $options['removedFromConversationTemplate'], + 'RemovedFromConversation.Sound' => + $options['removedFromConversationSound'], + 'NewMessage.WithMedia.Enabled' => + Serialize::booleanToString($options['newMessageWithMediaEnabled']), + 'NewMessage.WithMedia.Template' => + $options['newMessageWithMediaTemplate'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php new file mode 100644 index 0000000..bb6e09f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'newMessage' => Values::array_get($payload, 'new_message'), + 'addedToConversation' => Values::array_get($payload, 'added_to_conversation'), + 'removedFromConversation' => Values::array_get($payload, 'removed_from_conversation'), + 'logEnabled' => Values::array_get($payload, 'log_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Updated NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NotificationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php new file mode 100644 index 0000000..fe2153d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php @@ -0,0 +1,67 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a NotificationContext + */ + public function getContext( + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.NotificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php new file mode 100644 index 0000000..0ea7f1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php @@ -0,0 +1,294 @@ +options['logEnabled'] = $logEnabled; + $this->options['newMessageEnabled'] = $newMessageEnabled; + $this->options['newMessageTemplate'] = $newMessageTemplate; + $this->options['newMessageSound'] = $newMessageSound; + $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; + $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; + $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; + $this->options['addedToConversationSound'] = $addedToConversationSound; + $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; + $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; + $this->options['removedFromConversationSound'] = $removedFromConversationSound; + $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; + $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; + } + + /** + * Weather the notification logging is enabled. + * + * @param bool $logEnabled Weather the notification logging is enabled. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a conversation. The default is `false`. + * + * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageEnabled(bool $newMessageEnabled): self + { + $this->options['newMessageEnabled'] = $newMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. + * + * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageTemplate(string $newMessageTemplate): self + { + $this->options['newMessageTemplate'] = $newMessageTemplate; + return $this; + } + + /** + * The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. + * + * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageSound(string $newMessageSound): self + { + $this->options['newMessageSound'] = $newMessageSound; + return $this; + } + + /** + * Whether the new message badge is enabled. The default is `false`. + * + * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageBadgeCountEnabled(bool $newMessageBadgeCountEnabled): self + { + $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; + return $this; + } + + /** + * Whether to send a notification when a participant is added to a conversation. The default is `false`. + * + * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setAddedToConversationEnabled(bool $addedToConversationEnabled): self + { + $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * + * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setAddedToConversationTemplate(string $addedToConversationTemplate): self + { + $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; + return $this; + } + + /** + * The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * + * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setAddedToConversationSound(string $addedToConversationSound): self + { + $this->options['addedToConversationSound'] = $addedToConversationSound; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a conversation. The default is `false`. + * + * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationEnabled(bool $removedFromConversationEnabled): self + { + $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * + * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationTemplate(string $removedFromConversationTemplate): self + { + $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; + return $this; + } + + /** + * The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * + * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationSound(string $removedFromConversationSound): self + { + $this->options['removedFromConversationSound'] = $removedFromConversationSound; + return $this; + } + + /** + * Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. + * + * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageWithMediaEnabled(bool $newMessageWithMediaEnabled): self + { + $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. + * + * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageWithMediaTemplate(string $newMessageWithMediaTemplate): self + { + $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateNotificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php new file mode 100644 index 0000000..235e07d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Conversations\V1\Service\Configuration\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.NotificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php new file mode 100644 index 0000000..e245865 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php @@ -0,0 +1,119 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration/Webhooks'; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'Filters' => + Serialize::map($options['filters'], function ($e) { return $e; }), + 'Method' => + $options['method'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php new file mode 100644 index 0000000..2d27ed1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'filters' => Values::array_get($payload, 'filters'), + 'method' => Values::array_get($payload, 'method'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php new file mode 100644 index 0000000..f7d7639 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php @@ -0,0 +1,67 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a WebhookContext + */ + public function getContext( + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php new file mode 100644 index 0000000..a9f0b38 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php @@ -0,0 +1,132 @@ +options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['filters'] = $filters; + $this->options['method'] = $method; + } + + /** + * The absolute url the pre-event webhook request should be sent to. + * + * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The absolute url the post-event webhook request should be sent to. + * + * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. + * + * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. + * @return $this Fluent Builder + */ + public function setFilters(array $filters): self + { + $this->options['filters'] = $filters; + return $this; + } + + /** + * The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. + * + * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php new file mode 100644 index 0000000..2730b6c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Configuration\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php new file mode 100644 index 0000000..1e9eff5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php @@ -0,0 +1,119 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConfigurationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultConversationCreatorRoleSid' => + $options['defaultConversationCreatorRoleSid'], + 'DefaultConversationRoleSid' => + $options['defaultConversationRoleSid'], + 'DefaultChatServiceRoleSid' => + $options['defaultChatServiceRoleSid'], + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConfigurationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php new file mode 100644 index 0000000..07ac225 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'defaultConversationCreatorRoleSid' => Values::array_get($payload, 'default_conversation_creator_role_sid'), + 'defaultConversationRoleSid' => Values::array_get($payload, 'default_conversation_role_sid'), + 'defaultChatServiceRoleSid' => Values::array_get($payload, 'default_chat_service_role_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php new file mode 100644 index 0000000..cb8421e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php @@ -0,0 +1,143 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['chatServiceSid'] + ); + } + return $this->_notifications; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['chatServiceSid'] + ); + } + return $this->_webhooks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Conversations.V1.ConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php new file mode 100644 index 0000000..cd35728 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php @@ -0,0 +1,132 @@ +options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; + $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; + $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + } + + /** + * The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultConversationCreatorRoleSid(string $defaultConversationCreatorRoleSid): self + { + $this->options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; + return $this; + } + + /** + * The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultConversationRoleSid(string $defaultConversationRoleSid): self + { + $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; + return $this; + } + + /** + * The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChatServiceRoleSid(string $defaultChatServiceRoleSid): self + { + $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; + return $this; + } + + /** + * Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. + * + * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php new file mode 100644 index 0000000..b455b32 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\Service\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php new file mode 100644 index 0000000..7249a4a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php @@ -0,0 +1,101 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeliveryReceiptInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php new file mode 100644 index 0000000..c485682 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'messageSid' => Values::array_get($payload, 'message_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + '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 = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, '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 DeliveryReceiptContext Context for this DeliveryReceiptInstance + */ + protected function proxy(): DeliveryReceiptContext + { + if (!$this->context) { + $this->context = new DeliveryReceiptContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php new file mode 100644 index 0000000..5db7982 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php @@ -0,0 +1,182 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts'; + } + + /** + * Reads DeliveryReceiptInstance 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 DeliveryReceiptInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeliveryReceiptInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeliveryReceiptInstance 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 DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeliveryReceiptPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function getPage(string $targetUrl): DeliveryReceiptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeliveryReceiptContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): DeliveryReceiptContext + { + return new DeliveryReceiptContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php new file mode 100644 index 0000000..8cf6dc0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptInstance + */ + public function buildInstance(array $payload): DeliveryReceiptInstance + { + return new DeliveryReceiptInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php new file mode 100644 index 0000000..6d6be8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php @@ -0,0 +1,214 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'Subject' => + $options['subject'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + if (!$this->_deliveryReceipts) { + $this->_deliveryReceipts = new DeliveryReceiptList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->_deliveryReceipts; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php new file mode 100644 index 0000000..21b4ed1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php @@ -0,0 +1,188 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'index' => Values::array_get($payload, 'index'), + 'author' => Values::array_get($payload, 'author'), + 'body' => Values::array_get($payload, 'body'), + 'media' => Values::array_get($payload, 'media'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'delivery' => Values::array_get($payload, 'delivery'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'contentSid' => Values::array_get($payload, 'content_sid'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + return $this->proxy()->deliveryReceipts; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php new file mode 100644 index 0000000..985d629 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php @@ -0,0 +1,229 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MediaSid' => + $options['mediaSid'], + 'ContentSid' => + $options['contentSid'], + 'ContentVariables' => + $options['contentVariables'], + 'Subject' => + $options['subject'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php new file mode 100644 index 0000000..625af20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php @@ -0,0 +1,504 @@ +options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['mediaSid'] = $mediaSid; + $this->options['contentSid'] = $contentSid; + $this->options['contentVariables'] = $contentVariables; + $this->options['subject'] = $subject; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The Media SID to be attached to the new Message. + * + * @param string $mediaSid The Media SID to be attached to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * + * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * A structurally valid JSON string that contains values to resolve Rich Content template variables. + * + * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * The subject of the message, can be up to 256 characters long. + * + * @param string $subject The subject of the message, can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setSubject(string $subject): self + { + $this->options['subject'] = $subject; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @param string $body The content of the message, can be up to 1,600 characters long. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $subject The subject of the message, can be up to 256 characters long. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $author = Values::NONE, + string $body = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $subject = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['subject'] = $subject; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The subject of the message, can be up to 256 characters long. + * + * @param string $subject The subject of the message, can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setSubject(string $subject): self + { + $this->options['subject'] = $subject; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php new file mode 100644 index 0000000..b97dcb9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Conversations\V1\Service\Conversation\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php new file mode 100644 index 0000000..261d133 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php @@ -0,0 +1,160 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Identity' => + $options['identity'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + 'LastReadTimestamp' => + $options['lastReadTimestamp'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php new file mode 100644 index 0000000..03a899c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php new file mode 100644 index 0000000..2eb48bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php @@ -0,0 +1,221 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $options['identity'], + 'MessagingBinding.Address' => + $options['messagingBindingAddress'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + '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 ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php new file mode 100644 index 0000000..ffd4655 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php @@ -0,0 +1,490 @@ +options['identity'] = $identity; + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). + * + * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). + * @return $this Fluent Builder + */ + public function setMessagingBindingAddress(string $messagingBindingAddress): self + { + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + return $this; + } + + /** + * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The date on which this resource was created. + * + * @param \DateTime $dateCreated The date on which this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date on which this resource was last updated. + * + * @param \DateTime $dateUpdated The date on which this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; + } +} + +class DeleteParticipantOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; + } +} + + + +class UpdateParticipantOptions extends Options + { + /** + * @param \DateTime $dateCreated The date on which this resource was created. + * @param \DateTime $dateUpdated The date on which this resource was last updated. + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $identity = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $messagingBindingProxyAddress = Values::NONE, + string $messagingBindingProjectedAddress = Values::NONE, + int $lastReadMessageIndex = Values::INT_NONE, + string $lastReadTimestamp = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['identity'] = $identity; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The date on which this resource was created. + * + * @param \DateTime $dateCreated The date on which this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date on which this resource was last updated. + * + * @param \DateTime $dateUpdated The date on which this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(string $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php new file mode 100644 index 0000000..9bb000a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php new file mode 100644 index 0000000..09de4b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php @@ -0,0 +1,149 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php new file mode 100644 index 0000000..e55f325 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php new file mode 100644 index 0000000..4e9d0ec --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php @@ -0,0 +1,220 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $target + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.ReplayAfter' => + $options['configurationReplayAfter'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php new file mode 100644 index 0000000..1f785a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php @@ -0,0 +1,292 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The message index for which and it's successors the webhook will be replayed. Not set by default + * + * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default + * @return $this Fluent Builder + */ + public function setConfigurationReplayAfter(int $configurationReplayAfter): self + { + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @param string $configurationMethod + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php new file mode 100644 index 0000000..8f1cc1e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Conversation\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php new file mode 100644 index 0000000..7f3e624 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php @@ -0,0 +1,256 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'UniqueName' => + $options['uniqueName'], + 'Bindings.Email.Address' => + $options['bindingsEmailAddress'], + 'Bindings.Email.Name' => + $options['bindingsEmailName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php new file mode 100644 index 0000000..3cce9d6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php @@ -0,0 +1,202 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'state' => Values::array_get($payload, 'state'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'timers' => Values::array_get($payload, 'timers'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'bindings' => Values::array_get($payload, 'bindings'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConversationContext Context for this ConversationInstance + */ + protected function proxy(): ConversationContext + { + if (!$this->context) { + $this->context = new ConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationList.php new file mode 100644 index 0000000..def8310 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationList.php @@ -0,0 +1,229 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations'; + } + + /** + * Create the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Created ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'Bindings.Email.Address' => + $options['bindingsEmailAddress'], + 'Bindings.Email.Name' => + $options['bindingsEmailName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Reads ConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param 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 ConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConversationPage Page of ConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'StartDate' => + $options['startDate'], + 'EndDate' => + $options['endDate'], + 'State' => + $options['state'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConversationPage Page of ConversationInstance + */ + public function getPage(string $targetUrl): ConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConversationContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. + */ + public function getContext( + string $sid + + ): ConversationContext + { + return new ConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php new file mode 100644 index 0000000..62306ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php @@ -0,0 +1,662 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + $this->options['bindingsEmailName'] = $bindingsEmailName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * The default email address that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailAddress(string $bindingsEmailAddress): self + { + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + return $this; + } + + /** + * The default name that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailName(string $bindingsEmailName): self + { + $this->options['bindingsEmailName'] = $bindingsEmailName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; + } +} + +class DeleteConversationOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; + } +} + + +class ReadConversationOptions extends Options + { + /** + * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + */ + public function __construct( + + string $startDate = Values::NONE, + string $endDate = Values::NONE, + string $state = Values::NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['state'] = $state; + } + + /** + * Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * + * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @return $this Fluent Builder + */ + public function setStartDate(string $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @return $this Fluent Builder + */ + public function setEndDate(string $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; + } +} + +class UpdateConversationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @param string $state + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $state = Values::NONE, + string $timersInactive = Values::NONE, + string $timersClosed = Values::NONE, + string $uniqueName = Values::NONE, + string $bindingsEmailAddress = Values::NONE, + string $bindingsEmailName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['uniqueName'] = $uniqueName; + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + $this->options['bindingsEmailName'] = $bindingsEmailName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The default email address that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailAddress(string $bindingsEmailAddress): self + { + $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; + return $this; + } + + /** + * The default name that will be used when sending outbound emails in this conversation. + * + * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. + * @return $this Fluent Builder + */ + public function setBindingsEmailName(string $bindingsEmailName): self + { + $this->options['bindingsEmailName'] = $bindingsEmailName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationPage.php new file mode 100644 index 0000000..a33f8c0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConversationInstance \Twilio\Rest\Conversations\V1\Service\ConversationInstance + */ + public function buildInstance(array $payload): ConversationInstance + { + return new ConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php new file mode 100644 index 0000000..6b77d35 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php @@ -0,0 +1,112 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), + 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), + 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), + 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), + 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), + 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php new file mode 100644 index 0000000..1f8af70 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php @@ -0,0 +1,160 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/ParticipantConversations'; + } + + /** + * Reads ParticipantConversationInstance 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 ParticipantConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantConversationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantConversationInstance 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 ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + $options['identity'], + 'Address' => + $options['address'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function getPage(string $targetUrl): ParticipantConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php new file mode 100644 index 0000000..c8daba5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php @@ -0,0 +1,94 @@ +options['identity'] = $identity; + $this->options['address'] = $address; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * + * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * @return $this Fluent Builder + */ + public function setAddress(string $address): self + { + $this->options['address'] = $address; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php new file mode 100644 index 0000000..56d4647 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\Service\ParticipantConversationInstance + */ + public function buildInstance(array $payload): ParticipantConversationInstance + { + return new ParticipantConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php new file mode 100644 index 0000000..263bf01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php @@ -0,0 +1,131 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleInstance.php new file mode 100644 index 0000000..abcc76b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_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 = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleList.php new file mode 100644 index 0000000..5c236d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RoleList.php @@ -0,0 +1,202 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RolePage.php new file mode 100644 index 0000000..c74ea9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Conversations\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php new file mode 100644 index 0000000..e2d01d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php @@ -0,0 +1,145 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'userSid' => + $userSid, + 'conversationSid' => + $conversationSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .''; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastReadTimestamp' => + Serialize::iso8601DateTime($options['lastReadTimestamp']), + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php new file mode 100644 index 0000000..115c127 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php @@ -0,0 +1,180 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'timers' => Values::array_get($payload, 'timers'), + 'attributes' => Values::array_get($payload, 'attributes'), + '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'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserConversationContext Context for this UserConversationInstance + */ + protected function proxy(): UserConversationContext + { + if (!$this->context) { + $this->context = new UserConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php new file mode 100644 index 0000000..8e7a591 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php @@ -0,0 +1,175 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Conversations'; + } + + /** + * Reads UserConversationInstance 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 UserConversationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserConversationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserConversationInstance 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 UserConversationPage Page of UserConversationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserConversationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserConversationPage Page of UserConversationInstance + */ + public function getPage(string $targetUrl): UserConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserConversationContext + * + * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). + */ + public function getContext( + string $conversationSid + + ): UserConversationContext + { + return new UserConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $conversationSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php new file mode 100644 index 0000000..f35df56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The date of the last message read in conversation by the user, given in ISO 8601 format. + * + * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The index of the last Message in the Conversation that the Participant has read. + * + * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php new file mode 100644 index 0000000..6695aa3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserConversationInstance \Twilio\Rest\Conversations\V1\Service\User\UserConversationInstance + */ + public function buildInstance(array $payload): UserConversationInstance + { + return new UserConversationInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserContext.php new file mode 100644 index 0000000..fe425ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserContext.php @@ -0,0 +1,199 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + if (!$this->_userConversations) { + $this->_userConversations = new UserConversationList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_userConversations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserInstance.php new file mode 100644 index 0000000..7e23234 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserInstance.php @@ -0,0 +1,180 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + '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')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + return $this->proxy()->userConversations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserList.php new file mode 100644 index 0000000..e588f4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserList.php @@ -0,0 +1,205 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserOptions.php new file mode 100644 index 0000000..82a56c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserOptions.php @@ -0,0 +1,292 @@ +options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; + } +} + +class DeleteUserOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; + } +} + + + +class UpdateUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserPage.php new file mode 100644 index 0000000..b16dfcd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Conversations\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceContext.php new file mode 100644 index 0000000..4f29882 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceContext.php @@ -0,0 +1,249 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the participantConversations + */ + protected function getParticipantConversations(): ParticipantConversationList + { + if (!$this->_participantConversations) { + $this->_participantConversations = new ParticipantConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participantConversations; + } + + /** + * Access the conversations + */ + protected function getConversations(): ConversationList + { + if (!$this->_conversations) { + $this->_conversations = new ConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_conversations; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the configuration + */ + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_configuration; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceInstance.php new file mode 100644 index 0000000..2de90ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceInstance.php @@ -0,0 +1,201 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + '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')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the participantConversations + */ + protected function getParticipantConversations(): ParticipantConversationList + { + return $this->proxy()->participantConversations; + } + + /** + * Access the conversations + */ + protected function getConversations(): ConversationList + { + return $this->proxy()->conversations; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the configuration + */ + protected function getConfiguration(): ConfigurationList + { + return $this->proxy()->configuration; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceList.php new file mode 100644 index 0000000..db7df0f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServiceList.php @@ -0,0 +1,187 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName The human-readable name of this service, limited to 256 characters. Optional. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServicePage.php new file mode 100644 index 0000000..39d3e32 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Conversations\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php new file mode 100644 index 0000000..c2fa69c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php @@ -0,0 +1,138 @@ +solution = [ + 'userSid' => + $userSid, + 'conversationSid' => + $conversationSid, + ]; + + $this->uri = '/Users/' . \rawurlencode($userSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .''; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastReadTimestamp' => + Serialize::iso8601DateTime($options['lastReadTimestamp']), + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php new file mode 100644 index 0000000..4c5a463 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'timers' => Values::array_get($payload, 'timers'), + 'attributes' => Values::array_get($payload, 'attributes'), + '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'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserConversationContext Context for this UserConversationInstance + */ + protected function proxy(): UserConversationContext + { + if (!$this->context) { + $this->context = new UserConversationContext( + $this->version, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationList.php new file mode 100644 index 0000000..2583450 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationList.php @@ -0,0 +1,168 @@ +solution = [ + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Users/' . \rawurlencode($userSid) + .'/Conversations'; + } + + /** + * Reads UserConversationInstance 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 UserConversationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserConversationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserConversationInstance 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 UserConversationPage Page of UserConversationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserConversationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserConversationPage Page of UserConversationInstance + */ + public function getPage(string $targetUrl): UserConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserConversationContext + * + * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). + */ + public function getContext( + string $conversationSid + + ): UserConversationContext + { + return new UserConversationContext( + $this->version, + $this->solution['userSid'], + $conversationSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php new file mode 100644 index 0000000..7fd9741 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The date of the last message read in conversation by the user, given in ISO 8601 format. + * + * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The index of the last Message in the Conversation that the Participant has read. + * + * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationPage.php new file mode 100644 index 0000000..00ba6d6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserConversationInstance \Twilio\Rest\Conversations\V1\User\UserConversationInstance + */ + public function buildInstance(array $payload): UserConversationInstance + { + return new UserConversationInstance($this->version, $payload, $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserContext.php new file mode 100644 index 0000000..f887318 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserContext.php @@ -0,0 +1,191 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + if (!$this->_userConversations) { + $this->_userConversations = new UserConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_userConversations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserInstance.php new file mode 100644 index 0000000..cf613c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + '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')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + return $this->proxy()->userConversations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserList.php new file mode 100644 index 0000000..8f924b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserOptions.php new file mode 100644 index 0000000..105bf1b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserOptions.php @@ -0,0 +1,292 @@ +options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; + } +} + +class DeleteUserOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; + } +} + + + +class UpdateUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserPage.php new file mode 100644 index 0000000..f84294b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Conversations\V1\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ConversationsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ConversationsBase.php new file mode 100644 index 0000000..fc3e431 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ConversationsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://conversations.twilio.com'; + } + + + /** + * @return V1 Version v1 of conversations + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Conversations]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events.php b/vendor/twilio/sdk/src/Twilio/Rest/Events.php new file mode 100644 index 0000000..c712da0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events.php @@ -0,0 +1,76 @@ +eventTypes instead. + */ + protected function getEventTypes(): \Twilio\Rest\Events\V1\EventTypeList { + echo "eventTypes is deprecated. Use v1->eventTypes instead."; + return $this->v1->eventTypes; + } + + /** + * @deprecated Use v1->eventTypes(\$type) instead. + * @param string $type A string that uniquely identifies this Event Type. + */ + protected function contextEventTypes(string $type): \Twilio\Rest\Events\V1\EventTypeContext { + echo "eventTypes(\$type) is deprecated. Use v1->eventTypes(\$type) instead."; + return $this->v1->eventTypes($type); + } + + /** + * @deprecated Use v1->schemas instead. + */ + protected function getSchemas(): \Twilio\Rest\Events\V1\SchemaList { + echo "schemas is deprecated. Use v1->schemas instead."; + return $this->v1->schemas; + } + + /** + * @deprecated Use v1->schemas(\$id) instead. + * @param string $id The unique identifier of the schema. + */ + protected function contextSchemas(string $id): \Twilio\Rest\Events\V1\SchemaContext { + echo "schemas(\$id) is deprecated. Use v1->schemas(\$id) instead."; + return $this->v1->schemas($id); + } + + /** + * @deprecated Use v1->sinks instead. + */ + protected function getSinks(): \Twilio\Rest\Events\V1\SinkList { + echo "sinks is deprecated. Use v1->sinks instead."; + return $this->v1->sinks; + } + + /** + * @deprecated Use v1->sinks(\$sid) instead + * @param string $sid A string that uniquely identifies this Sink. + */ + protected function contextSinks(string $sid): \Twilio\Rest\Events\V1\SinkContext { + echo "sinks(\$sid) is deprecated. Use v1->sinks(\$sid) instead."; + return $this->v1->sinks($sid); + } + + /** + * @deprecated Use v1->subscriptions instead. + */ + protected function getSubscriptions(): \Twilio\Rest\Events\V1\SubscriptionList { + echo "subscriptions is deprecated. Use v1->subscriptions instead."; + return $this->v1->subscriptions; + } + + /** + * @deprecated Use v1->subscriptions(\$sid) instead. + * @param string $sid A string that uniquely identifies this Subscription. + */ + protected function contextSubscriptions(string $sid): \Twilio\Rest\Events\V1\SubscriptionContext { + echo "subscriptions(\$sid) is deprecated. Use v1->subscriptions(\$sid) instead."; + return $this->v1->subscriptions($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1.php new file mode 100644 index 0000000..407c493 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1.php @@ -0,0 +1,131 @@ +version = 'v1'; + } + + protected function getEventTypes(): EventTypeList + { + if (!$this->_eventTypes) { + $this->_eventTypes = new EventTypeList($this); + } + return $this->_eventTypes; + } + + protected function getSchemas(): SchemaList + { + if (!$this->_schemas) { + $this->_schemas = new SchemaList($this); + } + return $this->_schemas; + } + + protected function getSinks(): SinkList + { + if (!$this->_sinks) { + $this->_sinks = new SinkList($this); + } + return $this->_sinks; + } + + protected function getSubscriptions(): SubscriptionList + { + if (!$this->_subscriptions) { + $this->_subscriptions = new SubscriptionList($this); + } + return $this->_subscriptions; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Events.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeContext.php new file mode 100644 index 0000000..18d6277 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'type' => + $type, + ]; + + $this->uri = '/Types/' . \rawurlencode($type) + .''; + } + + /** + * Fetch the EventTypeInstance + * + * @return EventTypeInstance Fetched EventTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EventTypeInstance( + $this->version, + $payload, + $this->solution['type'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.EventTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeInstance.php new file mode 100644 index 0000000..a5cb4a1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'type' => Values::array_get($payload, 'type'), + 'schemaId' => Values::array_get($payload, 'schema_id'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'status' => Values::array_get($payload, 'status'), + 'documentationUrl' => Values::array_get($payload, 'documentation_url'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['type' => $type ?: $this->properties['type'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EventTypeContext Context for this EventTypeInstance + */ + protected function proxy(): EventTypeContext + { + if (!$this->context) { + $this->context = new EventTypeContext( + $this->version, + $this->solution['type'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventTypeInstance + * + * @return EventTypeInstance Fetched EventTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.EventTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeList.php new file mode 100644 index 0000000..a6e2ec6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeList.php @@ -0,0 +1,168 @@ +solution = [ + ]; + + $this->uri = '/Types'; + } + + /** + * Reads EventTypeInstance 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 EventTypeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EventTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventTypeInstance 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 EventTypePage Page of EventTypeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventTypePage + { + $options = new Values($options); + + $params = Values::of([ + 'SchemaId' => + $options['schemaId'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventTypePage Page of EventTypeInstance + */ + public function getPage(string $targetUrl): EventTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventTypeContext + * + * @param string $type A string that uniquely identifies this Event Type. + */ + public function getContext( + string $type + + ): EventTypeContext + { + return new EventTypeContext( + $this->version, + $type + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.EventTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeOptions.php new file mode 100644 index 0000000..00543ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypeOptions.php @@ -0,0 +1,78 @@ +options['schemaId'] = $schemaId; + } + + /** + * A string parameter filtering the results to return only the Event Types using a given schema. + * + * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. + * @return $this Fluent Builder + */ + public function setSchemaId(string $schemaId): self + { + $this->options['schemaId'] = $schemaId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadEventTypeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypePage.php new file mode 100644 index 0000000..956f4db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/EventTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventTypeInstance \Twilio\Rest\Events\V1\EventTypeInstance + */ + public function buildInstance(array $payload): EventTypeInstance + { + return new EventTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.EventTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php new file mode 100644 index 0000000..db16526 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php @@ -0,0 +1,89 @@ +solution = [ + 'id' => + $id, + 'schemaVersion' => + $schemaVersion, + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .'/Versions/' . \rawurlencode($schemaVersion) + .''; + } + + /** + * Fetch the SchemaVersionInstance + * + * @return SchemaVersionInstance Fetched SchemaVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaVersionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SchemaVersionInstance( + $this->version, + $payload, + $this->solution['id'], + $this->solution['schemaVersion'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php new file mode 100644 index 0000000..8412330 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php @@ -0,0 +1,126 @@ +properties = [ + 'id' => Values::array_get($payload, 'id'), + 'schemaVersion' => Values::array_get($payload, 'schema_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + 'raw' => Values::array_get($payload, 'raw'), + ]; + + $this->solution = ['id' => $id, 'schemaVersion' => $schemaVersion ?: $this->properties['schemaVersion'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SchemaVersionContext Context for this SchemaVersionInstance + */ + protected function proxy(): SchemaVersionContext + { + if (!$this->context) { + $this->context = new SchemaVersionContext( + $this->version, + $this->solution['id'], + $this->solution['schemaVersion'] + ); + } + + return $this->context; + } + + /** + * Fetch the SchemaVersionInstance + * + * @return SchemaVersionInstance Fetched SchemaVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaVersionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php new file mode 100644 index 0000000..44d84ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php @@ -0,0 +1,168 @@ +solution = [ + 'id' => + $id, + + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .'/Versions'; + } + + /** + * Reads SchemaVersionInstance 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 SchemaVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SchemaVersionInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SchemaVersionInstance 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 SchemaVersionPage Page of SchemaVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SchemaVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SchemaVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SchemaVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SchemaVersionPage Page of SchemaVersionInstance + */ + public function getPage(string $targetUrl): SchemaVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SchemaVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SchemaVersionContext + * + * @param int $schemaVersion The version of the schema + */ + public function getContext( + int $schemaVersion + + ): SchemaVersionContext + { + return new SchemaVersionContext( + $this->version, + $this->solution['id'], + $schemaVersion + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaVersionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php new file mode 100644 index 0000000..f7c4c0c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SchemaVersionInstance \Twilio\Rest\Events\V1\Schema\SchemaVersionInstance + */ + public function buildInstance(array $payload): SchemaVersionInstance + { + return new SchemaVersionInstance($this->version, $payload, $this->solution['id']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaVersionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaContext.php new file mode 100644 index 0000000..ce818e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaContext.php @@ -0,0 +1,141 @@ +solution = [ + 'id' => + $id, + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .''; + } + + /** + * Fetch the SchemaInstance + * + * @return SchemaInstance Fetched SchemaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SchemaInstance( + $this->version, + $payload, + $this->solution['id'] + ); + } + + + /** + * Access the versions + */ + protected function getVersions(): SchemaVersionList + { + if (!$this->_versions) { + $this->_versions = new SchemaVersionList( + $this->version, + $this->solution['id'] + ); + } + + return $this->_versions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaInstance.php new file mode 100644 index 0000000..e492737 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'id' => Values::array_get($payload, 'id'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'latestVersionDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'latest_version_date_created')), + 'latestVersion' => Values::array_get($payload, 'latest_version'), + ]; + + $this->solution = ['id' => $id ?: $this->properties['id'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SchemaContext Context for this SchemaInstance + */ + protected function proxy(): SchemaContext + { + if (!$this->context) { + $this->context = new SchemaContext( + $this->version, + $this->solution['id'] + ); + } + + return $this->context; + } + + /** + * Fetch the SchemaInstance + * + * @return SchemaInstance Fetched SchemaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the versions + */ + protected function getVersions(): SchemaVersionList + { + return $this->proxy()->versions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaList.php new file mode 100644 index 0000000..cd229c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a SchemaContext + * + * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. + */ + public function getContext( + string $id + + ): SchemaContext + { + return new SchemaContext( + $this->version, + $id + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaPage.php new file mode 100644 index 0000000..c03331f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SchemaPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SchemaInstance \Twilio\Rest\Events\V1\SchemaInstance + */ + public function buildInstance(array $payload): SchemaInstance + { + return new SchemaInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php new file mode 100644 index 0000000..0f139f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'result' => Values::array_get($payload, 'result'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php new file mode 100644 index 0000000..ae04e37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php @@ -0,0 +1,79 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .'/Test'; + } + + /** + * Create the SinkTestInstance + * + * @return SinkTestInstance Created SinkTestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SinkTestInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new SinkTestInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestPage.php new file mode 100644 index 0000000..3995b87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkTestInstance \Twilio\Rest\Events\V1\Sink\SinkTestInstance + */ + public function buildInstance(array $payload): SinkTestInstance + { + return new SinkTestInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php new file mode 100644 index 0000000..bc86c61 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'result' => Values::array_get($payload, 'result'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateList.php new file mode 100644 index 0000000..8c389ff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateList.php @@ -0,0 +1,85 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .'/Validate'; + } + + /** + * Create the SinkValidateInstance + * + * @param string $testId A 34 character string that uniquely identifies the test event for a Sink being validated. + * @return SinkValidateInstance Created SinkValidateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $testId): SinkValidateInstance + { + + $data = Values::of([ + 'TestId' => + $testId, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SinkValidateInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php new file mode 100644 index 0000000..e3f5c6f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkValidateInstance \Twilio\Rest\Events\V1\Sink\SinkValidateInstance + */ + public function buildInstance(array $payload): SinkValidateInstance + { + return new SinkValidateInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkContext.php new file mode 100644 index 0000000..d0e1acc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkContext.php @@ -0,0 +1,198 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SinkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SinkInstance + * + * @return SinkInstance Fetched SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SinkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SinkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @return SinkInstance Updated SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $description): SinkInstance + { + + $data = Values::of([ + 'Description' => + $description, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SinkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the sinkTest + */ + protected function getSinkTest(): SinkTestList + { + if (!$this->_sinkTest) { + $this->_sinkTest = new SinkTestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sinkTest; + } + + /** + * Access the sinkValidate + */ + protected function getSinkValidate(): SinkValidateList + { + if (!$this->_sinkValidate) { + $this->_sinkValidate = new SinkValidateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sinkValidate; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SinkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkInstance.php new file mode 100644 index 0000000..d08b169 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'sid' => Values::array_get($payload, 'sid'), + 'sinkConfiguration' => Values::array_get($payload, 'sink_configuration'), + 'sinkType' => Values::array_get($payload, 'sink_type'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SinkContext Context for this SinkInstance + */ + protected function proxy(): SinkContext + { + if (!$this->context) { + $this->context = new SinkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SinkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SinkInstance + * + * @return SinkInstance Fetched SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SinkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @return SinkInstance Updated SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $description): SinkInstance + { + + return $this->proxy()->update($description); + } + + /** + * Access the sinkTest + */ + protected function getSinkTest(): SinkTestList + { + return $this->proxy()->sinkTest; + } + + /** + * Access the sinkValidate + */ + protected function getSinkValidate(): SinkValidateList + { + return $this->proxy()->sinkValidate; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SinkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkList.php new file mode 100644 index 0000000..66361f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Sinks'; + } + + /** + * Create the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @param array $sinkConfiguration The information required for Twilio to connect to the provided Sink encoded as JSON. + * @param string $sinkType + * @return SinkInstance Created SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $description, array $sinkConfiguration, string $sinkType): SinkInstance + { + + $data = Values::of([ + 'Description' => + $description, + 'SinkConfiguration' => + Serialize::jsonObject($sinkConfiguration), + 'SinkType' => + $sinkType, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SinkInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SinkInstance 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 SinkInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SinkInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SinkInstance 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 SinkPage Page of SinkInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SinkPage + { + $options = new Values($options); + + $params = Values::of([ + 'InUse' => + Serialize::booleanToString($options['inUse']), + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SinkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SinkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SinkPage Page of SinkInstance + */ + public function getPage(string $targetUrl): SinkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SinkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SinkContext + * + * @param string $sid A 34 character string that uniquely identifies this Sink. + */ + public function getContext( + string $sid + + ): SinkContext + { + return new SinkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkOptions.php new file mode 100644 index 0000000..c0b4160 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkOptions.php @@ -0,0 +1,102 @@ +options['inUse'] = $inUse; + $this->options['status'] = $status; + } + + /** + * A boolean query parameter filtering the results to return sinks used/not used by a subscription. + * + * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. + * @return $this Fluent Builder + */ + public function setInUse(bool $inUse): self + { + $this->options['inUse'] = $inUse; + return $this; + } + + /** + * A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. + * + * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadSinkOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkPage.php new file mode 100644 index 0000000..e84779e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SinkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkInstance \Twilio\Rest\Events\V1\SinkInstance + */ + public function buildInstance(array $payload): SinkInstance + { + return new SinkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php new file mode 100644 index 0000000..2a4ab9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php @@ -0,0 +1,133 @@ +solution = [ + 'subscriptionSid' => + $subscriptionSid, + 'type' => + $type, + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) + .'/SubscribedEvents/' . \rawurlencode($type) + .''; + } + + /** + * Delete the SubscribedEventInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SubscribedEventInstance + * + * @return SubscribedEventInstance Fetched SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedEventInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + + /** + * Update the SubscribedEventInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Updated SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribedEventInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'SchemaVersion' => + $options['schemaVersion'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscribedEventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php new file mode 100644 index 0000000..e3f849a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'type' => Values::array_get($payload, 'type'), + 'schemaVersion' => Values::array_get($payload, 'schema_version'), + 'subscriptionSid' => Values::array_get($payload, 'subscription_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['subscriptionSid' => $subscriptionSid, 'type' => $type ?: $this->properties['type'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SubscribedEventContext Context for this SubscribedEventInstance + */ + protected function proxy(): SubscribedEventContext + { + if (!$this->context) { + $this->context = new SubscribedEventContext( + $this->version, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + return $this->context; + } + + /** + * Delete the SubscribedEventInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SubscribedEventInstance + * + * @return SubscribedEventInstance Fetched SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedEventInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SubscribedEventInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Updated SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribedEventInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscribedEventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php new file mode 100644 index 0000000..2830159 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php @@ -0,0 +1,201 @@ +solution = [ + 'subscriptionSid' => + $subscriptionSid, + + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) + .'/SubscribedEvents'; + } + + /** + * Create the SubscribedEventInstance + * + * @param string $type Type of event being subscribed to. + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Created SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): SubscribedEventInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'SchemaVersion' => + $options['schemaVersion'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'] + ); + } + + + /** + * Reads SubscribedEventInstance 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 SubscribedEventInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SubscribedEventInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscribedEventInstance 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 SubscribedEventPage Page of SubscribedEventInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscribedEventPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SubscribedEventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SubscribedEventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SubscribedEventPage Page of SubscribedEventInstance + */ + public function getPage(string $targetUrl): SubscribedEventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscribedEventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscribedEventContext + * + * @param string $type Type of event being subscribed to. + */ + public function getContext( + string $type + + ): SubscribedEventContext + { + return new SubscribedEventContext( + $this->version, + $this->solution['subscriptionSid'], + $type + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscribedEventList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php new file mode 100644 index 0000000..1d1beee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php @@ -0,0 +1,134 @@ +options['schemaVersion'] = $schemaVersion; + } + + /** + * The schema version that the Subscription should use. + * + * @param int $schemaVersion The schema version that the Subscription should use. + * @return $this Fluent Builder + */ + public function setSchemaVersion(int $schemaVersion): self + { + $this->options['schemaVersion'] = $schemaVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.CreateSubscribedEventOptions ' . $options . ']'; + } +} + + + + +class UpdateSubscribedEventOptions extends Options + { + /** + * @param int $schemaVersion The schema version that the Subscription should use. + */ + public function __construct( + + int $schemaVersion = Values::INT_NONE + + ) { + $this->options['schemaVersion'] = $schemaVersion; + } + + /** + * The schema version that the Subscription should use. + * + * @param int $schemaVersion The schema version that the Subscription should use. + * @return $this Fluent Builder + */ + public function setSchemaVersion(int $schemaVersion): self + { + $this->options['schemaVersion'] = $schemaVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.UpdateSubscribedEventOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php new file mode 100644 index 0000000..1f7465a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribedEventInstance \Twilio\Rest\Events\V1\Subscription\SubscribedEventInstance + */ + public function buildInstance(array $payload): SubscribedEventInstance + { + return new SubscribedEventInstance($this->version, $payload, $this->solution['subscriptionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscribedEventPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionContext.php new file mode 100644 index 0000000..0f1ae04 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionContext.php @@ -0,0 +1,186 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SubscriptionInstance + * + * @return SubscriptionInstance Fetched SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscriptionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SubscriptionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SubscriptionInstance + * + * @param array|Options $options Optional Arguments + * @return SubscriptionInstance Updated SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscriptionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Description' => + $options['description'], + 'SinkSid' => + $options['sinkSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SubscriptionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the subscribedEvents + */ + protected function getSubscribedEvents(): SubscribedEventList + { + if (!$this->_subscribedEvents) { + $this->_subscribedEvents = new SubscribedEventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_subscribedEvents; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionInstance.php new file mode 100644 index 0000000..43ed02d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'sinkSid' => Values::array_get($payload, 'sink_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SubscriptionContext Context for this SubscriptionInstance + */ + protected function proxy(): SubscriptionContext + { + if (!$this->context) { + $this->context = new SubscriptionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SubscriptionInstance + * + * @return SubscriptionInstance Fetched SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscriptionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SubscriptionInstance + * + * @param array|Options $options Optional Arguments + * @return SubscriptionInstance Updated SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscriptionInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the subscribedEvents + */ + protected function getSubscribedEvents(): SubscribedEventList + { + return $this->proxy()->subscribedEvents; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionList.php new file mode 100644 index 0000000..f698785 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionList.php @@ -0,0 +1,201 @@ +solution = [ + ]; + + $this->uri = '/Subscriptions'; + } + + /** + * Create the SubscriptionInstance + * + * @param string $description A human readable description for the Subscription **This value should not contain PII.** + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * @param array[] $types An array of objects containing the subscribed Event Types + * @return SubscriptionInstance Created SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $description, string $sinkSid, array $types): SubscriptionInstance + { + + $data = Values::of([ + 'Description' => + $description, + 'SinkSid' => + $sinkSid, + 'Types' => + Serialize::map($types,function ($e) { return Serialize::jsonObject($e); }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SubscriptionInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SubscriptionInstance 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 SubscriptionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SubscriptionInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscriptionInstance 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 SubscriptionPage Page of SubscriptionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscriptionPage + { + $options = new Values($options); + + $params = Values::of([ + 'SinkSid' => + $options['sinkSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SubscriptionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SubscriptionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SubscriptionPage Page of SubscriptionInstance + */ + public function getPage(string $targetUrl): SubscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscriptionContext + * + * @param string $sid A 34 character string that uniquely identifies this Subscription. + */ + public function getContext( + string $sid + + ): SubscriptionContext + { + return new SubscriptionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscriptionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionOptions.php new file mode 100644 index 0000000..bb82b36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionOptions.php @@ -0,0 +1,152 @@ +options['sinkSid'] = $sinkSid; + } + + /** + * The SID of the sink that the list of Subscriptions should be filtered by. + * + * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. + * @return $this Fluent Builder + */ + public function setSinkSid(string $sinkSid): self + { + $this->options['sinkSid'] = $sinkSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadSubscriptionOptions ' . $options . ']'; + } +} + +class UpdateSubscriptionOptions extends Options + { + /** + * @param string $description A human readable description for the Subscription. + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + */ + public function __construct( + + string $description = Values::NONE, + string $sinkSid = Values::NONE + + ) { + $this->options['description'] = $description; + $this->options['sinkSid'] = $sinkSid; + } + + /** + * A human readable description for the Subscription. + * + * @param string $description A human readable description for the Subscription. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * @return $this Fluent Builder + */ + public function setSinkSid(string $sinkSid): self + { + $this->options['sinkSid'] = $sinkSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.UpdateSubscriptionOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionPage.php new file mode 100644 index 0000000..131f1f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Events/V1/SubscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscriptionInstance \Twilio\Rest\Events\V1\SubscriptionInstance + */ + public function buildInstance(array $payload): SubscriptionInstance + { + return new SubscriptionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscriptionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/EventsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/EventsBase.php new file mode 100644 index 0000000..e86260c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/EventsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://events.twilio.com'; + } + + + /** + * @return V1 Version v1 of events + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Events]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi.php new file mode 100644 index 0000000..ebcebfe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi.php @@ -0,0 +1,118 @@ +assessments instead. + */ + protected function getAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsList { + echo "assessments is deprecated. Use v1->assessments instead."; + return $this->v1->assessments; + } + + /** + * @deprecated Use v1->assessments() instead. + */ + protected function contextAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsContext { + echo "assessments() is deprecated. Use v1->assessments() instead."; + return $this->v1->assessments(); + } + + /** + * @deprecated Use v1->channel instead. + */ + protected function getChannel(): \Twilio\Rest\FlexApi\V1\ChannelList { + echo "channel is deprecated. Use v1->channel instead."; + return $this->v1->channel; + } + + /** + * @deprecated Use v1->channel(\$sid) instead. + * @param string $sid The SID that identifies the Flex chat channel resource to + * fetch + */ + protected function contextChannel(string $sid): \Twilio\Rest\FlexApi\V1\ChannelContext { + echo "channel(\$sid) is deprecated. Use v1->channel(\$sid) instead."; + return $this->v1->channel($sid); + } + + /** + * @deprecated Use v1->configuration instead. + */ + protected function getConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationList { + echo "configuration is deprecated. Use v1->configuration instead."; + return $this->v1->configuration; + } + + /** + * @deprecated Use v1->configuration() instead. + */ + protected function contextConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationContext { + echo "configuration() is deprecated. Use v1->configuration() instead."; + return $this->v1->configuration(); + } + + /** + * @deprecated Use v1->flexFlow instead. + */ + protected function getFlexFlow(): \Twilio\Rest\FlexApi\V1\FlexFlowList { + echo "flexFlow is deprecated. Use v1->flexFlow instead."; + return $this->v1->flexFlow; + } + + /** + * @deprecated Use v1->flexFlow(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFlexFlow(string $sid): \Twilio\Rest\FlexApi\V1\FlexFlowContext { + echo "flexFlow(\$sid) is deprecated. Use v1->flexFlow(\$sid) instead."; + return $this->v1->flexFlow($sid); + } + + /** + * @deprecated Use v1->interaction instead. + */ + protected function getInteraction(): \Twilio\Rest\FlexApi\V1\InteractionList { + echo "interaction is deprecated. Use v1->interaction instead."; + return $this->v1->interaction; + } + + /** + * @deprecated Use v1->interaction(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextInteraction(string $sid): \Twilio\Rest\FlexApi\V1\InteractionContext { + echo "interaction(\$sid) is deprecated. Use v1->interaction(\$sid) instead."; + return $this->v1->interaction($sid); + } + + /** + * @deprecated Use v1->webChannel instead. + */ + protected function getWebChannel(): \Twilio\Rest\FlexApi\V1\WebChannelList { + echo "webChannel is deprecated. Use v1->webChannel instead."; + return $this->v1->webChannel; + } + + /** + * @deprecated Use v1->webChannel(\$sid) instead. + * @param string $sid The SID of the WebChannel resource to fetch + */ + protected function contextWebChannel(string $sid): \Twilio\Rest\FlexApi\V1\WebChannelContext { + echo "webChannel(\$sid) is deprecated. Use v1->webChannel(\$sid) instead."; + return $this->v1->webChannel($sid); + } + + /** + * @deprecated Use v2->webChannels instead. + */ + protected function getWebChannels(): \Twilio\Rest\FlexApi\V2\WebChannelsList { + echo "webChannels is deprecated. Use v2->webChannels instead."; + return $this->v2->webChannels; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1.php new file mode 100644 index 0000000..8facb46 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1.php @@ -0,0 +1,347 @@ +version = 'v1'; + } + + protected function getAssessments(): AssessmentsList + { + if (!$this->_assessments) { + $this->_assessments = new AssessmentsList($this); + } + return $this->_assessments; + } + + protected function getChannel(): ChannelList + { + if (!$this->_channel) { + $this->_channel = new ChannelList($this); + } + return $this->_channel; + } + + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList($this); + } + return $this->_configuration; + } + + protected function getFlexFlow(): FlexFlowList + { + if (!$this->_flexFlow) { + $this->_flexFlow = new FlexFlowList($this); + } + return $this->_flexFlow; + } + + protected function getInsightsAssessmentsComment(): InsightsAssessmentsCommentList + { + if (!$this->_insightsAssessmentsComment) { + $this->_insightsAssessmentsComment = new InsightsAssessmentsCommentList($this); + } + return $this->_insightsAssessmentsComment; + } + + protected function getInsightsConversations(): InsightsConversationsList + { + if (!$this->_insightsConversations) { + $this->_insightsConversations = new InsightsConversationsList($this); + } + return $this->_insightsConversations; + } + + protected function getInsightsQuestionnaires(): InsightsQuestionnairesList + { + if (!$this->_insightsQuestionnaires) { + $this->_insightsQuestionnaires = new InsightsQuestionnairesList($this); + } + return $this->_insightsQuestionnaires; + } + + protected function getInsightsQuestionnairesCategory(): InsightsQuestionnairesCategoryList + { + if (!$this->_insightsQuestionnairesCategory) { + $this->_insightsQuestionnairesCategory = new InsightsQuestionnairesCategoryList($this); + } + return $this->_insightsQuestionnairesCategory; + } + + protected function getInsightsQuestionnairesQuestion(): InsightsQuestionnairesQuestionList + { + if (!$this->_insightsQuestionnairesQuestion) { + $this->_insightsQuestionnairesQuestion = new InsightsQuestionnairesQuestionList($this); + } + return $this->_insightsQuestionnairesQuestion; + } + + protected function getInsightsSegments(): InsightsSegmentsList + { + if (!$this->_insightsSegments) { + $this->_insightsSegments = new InsightsSegmentsList($this); + } + return $this->_insightsSegments; + } + + protected function getInsightsSession(): InsightsSessionList + { + if (!$this->_insightsSession) { + $this->_insightsSession = new InsightsSessionList($this); + } + return $this->_insightsSession; + } + + protected function getInsightsSettingsAnswerSets(): InsightsSettingsAnswerSetsList + { + if (!$this->_insightsSettingsAnswerSets) { + $this->_insightsSettingsAnswerSets = new InsightsSettingsAnswerSetsList($this); + } + return $this->_insightsSettingsAnswerSets; + } + + protected function getInsightsSettingsComment(): InsightsSettingsCommentList + { + if (!$this->_insightsSettingsComment) { + $this->_insightsSettingsComment = new InsightsSettingsCommentList($this); + } + return $this->_insightsSettingsComment; + } + + protected function getInsightsUserRoles(): InsightsUserRolesList + { + if (!$this->_insightsUserRoles) { + $this->_insightsUserRoles = new InsightsUserRolesList($this); + } + return $this->_insightsUserRoles; + } + + protected function getInteraction(): InteractionList + { + if (!$this->_interaction) { + $this->_interaction = new InteractionList($this); + } + return $this->_interaction; + } + + protected function getPlugins(): PluginList + { + if (!$this->_plugins) { + $this->_plugins = new PluginList($this); + } + return $this->_plugins; + } + + protected function getPluginArchive(): PluginArchiveList + { + if (!$this->_pluginArchive) { + $this->_pluginArchive = new PluginArchiveList($this); + } + return $this->_pluginArchive; + } + + protected function getPluginConfigurations(): PluginConfigurationList + { + if (!$this->_pluginConfigurations) { + $this->_pluginConfigurations = new PluginConfigurationList($this); + } + return $this->_pluginConfigurations; + } + + protected function getPluginConfigurationArchive(): PluginConfigurationArchiveList + { + if (!$this->_pluginConfigurationArchive) { + $this->_pluginConfigurationArchive = new PluginConfigurationArchiveList($this); + } + return $this->_pluginConfigurationArchive; + } + + protected function getPluginReleases(): PluginReleaseList + { + if (!$this->_pluginReleases) { + $this->_pluginReleases = new PluginReleaseList($this); + } + return $this->_pluginReleases; + } + + protected function getPluginVersionArchive(): PluginVersionArchiveList + { + if (!$this->_pluginVersionArchive) { + $this->_pluginVersionArchive = new PluginVersionArchiveList($this); + } + return $this->_pluginVersionArchive; + } + + protected function getProvisioningStatus(): ProvisioningStatusList + { + if (!$this->_provisioningStatus) { + $this->_provisioningStatus = new ProvisioningStatusList($this); + } + return $this->_provisioningStatus; + } + + protected function getWebChannel(): WebChannelList + { + if (!$this->_webChannel) { + $this->_webChannel = new WebChannelList($this); + } + return $this->_webChannel; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.FlexApi.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsContext.php new file mode 100644 index 0000000..d0d6a69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsContext.php @@ -0,0 +1,99 @@ +solution = [ + 'assessmentSid' => + $assessmentSid, + ]; + + $this->uri = '/Insights/QualityManagement/Assessments/' . \rawurlencode($assessmentSid) + .''; + } + + /** + * Update the AssessmentsInstance + * + * @param string $offset The offset of the conversation + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Updated AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Offset' => + $offset, + 'AnswerText' => + $answerText, + 'AnswerId' => + $answerId, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AssessmentsInstance( + $this->version, + $payload, + $this->solution['assessmentSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.AssessmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php new file mode 100644 index 0000000..e46bf51 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assessmentSid' => Values::array_get($payload, 'assessment_sid'), + 'offset' => Values::array_get($payload, 'offset'), + 'report' => Values::array_get($payload, 'report'), + 'weight' => Values::array_get($payload, 'weight'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'userName' => Values::array_get($payload, 'user_name'), + 'userEmail' => Values::array_get($payload, 'user_email'), + 'answerText' => Values::array_get($payload, 'answer_text'), + 'answerId' => Values::array_get($payload, 'answer_id'), + 'assessment' => Values::array_get($payload, 'assessment'), + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assessmentSid' => $assessmentSid ?: $this->properties['assessmentSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssessmentsContext Context for this AssessmentsInstance + */ + protected function proxy(): AssessmentsContext + { + if (!$this->context) { + $this->context = new AssessmentsContext( + $this->version, + $this->solution['assessmentSid'] + ); + } + + return $this->context; + } + + /** + * Update the AssessmentsInstance + * + * @param string $offset The offset of the conversation + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Updated AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance + { + + return $this->proxy()->update($offset, $answerText, $answerId, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.AssessmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsList.php new file mode 100644 index 0000000..4ac2a14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsList.php @@ -0,0 +1,226 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Assessments'; + } + + /** + * Create the AssessmentsInstance + * + * @param string $categorySid The SID of the category + * @param string $categoryName The name of the category + * @param string $segmentId Segment Id of the conversation + * @param string $agentId The id of the Agent + * @param string $offset The offset of the conversation. + * @param string $metricId The question SID selected for assessment + * @param string $metricName The question name of the assessment + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param string $questionnaireSid Questionnaire SID of the associated question + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Created AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categorySid, string $categoryName, string $segmentId, string $agentId, string $offset, string $metricId, string $metricName, string $answerText, string $answerId, string $questionnaireSid, array $options = []): AssessmentsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategorySid' => + $categorySid, + 'CategoryName' => + $categoryName, + 'SegmentId' => + $segmentId, + 'AgentId' => + $agentId, + 'Offset' => + $offset, + 'MetricId' => + $metricId, + 'MetricName' => + $metricName, + 'AnswerText' => + $answerText, + 'AnswerId' => + $answerId, + 'QuestionnaireSid' => + $questionnaireSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AssessmentsInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AssessmentsInstance 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 AssessmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AssessmentsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssessmentsInstance 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 AssessmentsPage Page of AssessmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssessmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssessmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssessmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssessmentsPage Page of AssessmentsInstance + */ + public function getPage(string $targetUrl): AssessmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssessmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssessmentsContext + * + * @param string $assessmentSid The SID of the assessment to be modified + */ + public function getContext( + string $assessmentSid + + ): AssessmentsContext + { + return new AssessmentsContext( + $this->version, + $assessmentSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.AssessmentsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php new file mode 100644 index 0000000..3e6a823 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php @@ -0,0 +1,198 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateAssessmentsOptions ' . $options . ']'; + } +} + +class ReadAssessmentsOptions extends Options + { + /** + * @param string $segmentId The id of the segment. + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $segmentId = Values::NONE, + string $authorization = Values::NONE + + ) { + $this->options['segmentId'] = $segmentId; + $this->options['authorization'] = $authorization; + } + + /** + * The id of the segment. + * + * @param string $segmentId The id of the segment. + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadAssessmentsOptions ' . $options . ']'; + } +} + +class UpdateAssessmentsOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateAssessmentsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsPage.php new file mode 100644 index 0000000..f3b53cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssessmentsInstance \Twilio\Rest\FlexApi\V1\AssessmentsInstance + */ + public function buildInstance(array $payload): AssessmentsInstance + { + return new AssessmentsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.AssessmentsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelContext.php new file mode 100644 index 0000000..103e3d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelContext.php @@ -0,0 +1,97 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelInstance.php new file mode 100644 index 0000000..15ffe55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'url' => Values::array_get($payload, 'url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelList.php new file mode 100644 index 0000000..e703a25 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelList.php @@ -0,0 +1,213 @@ +solution = [ + ]; + + $this->uri = '/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param string $flexFlowSid The SID of the Flex Flow. + * @param string $identity The `identity` value that uniquely identifies the new resource's chat User. + * @param string $chatUserFriendlyName The chat participant's friendly name. + * @param string $chatFriendlyName The chat channel's friendly name. + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $flexFlowSid, string $identity, string $chatUserFriendlyName, string $chatFriendlyName, array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FlexFlowSid' => + $flexFlowSid, + 'Identity' => + $identity, + 'ChatUserFriendlyName' => + $chatUserFriendlyName, + 'ChatFriendlyName' => + $chatFriendlyName, + 'Target' => + $options['target'], + 'ChatUniqueName' => + $options['chatUniqueName'], + 'PreEngagementData' => + $options['preEngagementData'], + 'TaskSid' => + $options['taskSid'], + 'TaskAttributes' => + $options['taskAttributes'], + 'LongLived' => + Serialize::booleanToString($options['longLived']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + + $params = Values::of([ + '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 ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The SID of the Flex chat channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelOptions.php new file mode 100644 index 0000000..dfb94e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelOptions.php @@ -0,0 +1,172 @@ +options['target'] = $target; + $this->options['chatUniqueName'] = $chatUniqueName; + $this->options['preEngagementData'] = $preEngagementData; + $this->options['taskSid'] = $taskSid; + $this->options['taskAttributes'] = $taskAttributes; + $this->options['longLived'] = $longLived; + } + + /** + * The Target Contact Identity, for example the phone number of an SMS. + * + * @param string $target The Target Contact Identity, for example the phone number of an SMS. + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * The chat channel's unique name. + * + * @param string $chatUniqueName The chat channel's unique name. + * @return $this Fluent Builder + */ + public function setChatUniqueName(string $chatUniqueName): self + { + $this->options['chatUniqueName'] = $chatUniqueName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` + * + * @param string $taskSid The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` + * @return $this Fluent Builder + */ + public function setTaskSid(string $taskSid): self + { + $this->options['taskSid'] = $taskSid; + return $this; + } + + /** + * The Task attributes to be added for the TaskRouter Task. + * + * @param string $taskAttributes The Task attributes to be added for the TaskRouter Task. + * @return $this Fluent Builder + */ + public function setTaskAttributes(string $taskAttributes): self + { + $this->options['taskAttributes'] = $taskAttributes; + return $this; + } + + /** + * Whether to create the channel as long-lived. + * + * @param bool $longLived Whether to create the channel as long-lived. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelPage.php new file mode 100644 index 0000000..5397292 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\FlexApi\V1\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php new file mode 100644 index 0000000..71f7de0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php @@ -0,0 +1,107 @@ +solution = [ + ]; + + $this->uri = '/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'UiVersion' => + $options['uiVersion'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Update the ConfigurationInstance + * + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): ConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php new file mode 100644 index 0000000..27b6747 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php @@ -0,0 +1,224 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'attributes' => Values::array_get($payload, 'attributes'), + 'status' => Values::array_get($payload, 'status'), + 'taskrouterWorkspaceSid' => Values::array_get($payload, 'taskrouter_workspace_sid'), + 'taskrouterTargetWorkflowSid' => Values::array_get($payload, 'taskrouter_target_workflow_sid'), + 'taskrouterTargetTaskqueueSid' => Values::array_get($payload, 'taskrouter_target_taskqueue_sid'), + 'taskrouterTaskqueues' => Values::array_get($payload, 'taskrouter_taskqueues'), + 'taskrouterSkills' => Values::array_get($payload, 'taskrouter_skills'), + 'taskrouterWorkerChannels' => Values::array_get($payload, 'taskrouter_worker_channels'), + 'taskrouterWorkerAttributes' => Values::array_get($payload, 'taskrouter_worker_attributes'), + 'taskrouterOfflineActivitySid' => Values::array_get($payload, 'taskrouter_offline_activity_sid'), + 'runtimeDomain' => Values::array_get($payload, 'runtime_domain'), + 'messagingServiceInstanceSid' => Values::array_get($payload, 'messaging_service_instance_sid'), + 'chatServiceInstanceSid' => Values::array_get($payload, 'chat_service_instance_sid'), + 'flexServiceInstanceSid' => Values::array_get($payload, 'flex_service_instance_sid'), + 'flexInstanceSid' => Values::array_get($payload, 'flex_instance_sid'), + 'uiLanguage' => Values::array_get($payload, 'ui_language'), + 'uiAttributes' => Values::array_get($payload, 'ui_attributes'), + 'uiDependencies' => Values::array_get($payload, 'ui_dependencies'), + 'uiVersion' => Values::array_get($payload, 'ui_version'), + 'serviceVersion' => Values::array_get($payload, 'service_version'), + 'callRecordingEnabled' => Values::array_get($payload, 'call_recording_enabled'), + 'callRecordingWebhookUrl' => Values::array_get($payload, 'call_recording_webhook_url'), + 'crmEnabled' => Values::array_get($payload, 'crm_enabled'), + 'crmType' => Values::array_get($payload, 'crm_type'), + 'crmCallbackUrl' => Values::array_get($payload, 'crm_callback_url'), + 'crmFallbackUrl' => Values::array_get($payload, 'crm_fallback_url'), + 'crmAttributes' => Values::array_get($payload, 'crm_attributes'), + 'publicAttributes' => Values::array_get($payload, 'public_attributes'), + 'pluginServiceEnabled' => Values::array_get($payload, 'plugin_service_enabled'), + 'pluginServiceAttributes' => Values::array_get($payload, 'plugin_service_attributes'), + 'integrations' => Values::array_get($payload, 'integrations'), + 'outboundCallFlows' => Values::array_get($payload, 'outbound_call_flows'), + 'serverlessServiceSids' => Values::array_get($payload, 'serverless_service_sids'), + 'queueStatsConfiguration' => Values::array_get($payload, 'queue_stats_configuration'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'markdown' => Values::array_get($payload, 'markdown'), + 'url' => Values::array_get($payload, 'url'), + 'flexInsightsHr' => Values::array_get($payload, 'flex_insights_hr'), + 'flexInsightsDrilldown' => Values::array_get($payload, 'flex_insights_drilldown'), + 'flexUrl' => Values::array_get($payload, 'flex_url'), + 'channelConfigs' => Values::array_get($payload, 'channel_configs'), + 'debuggerIntegration' => Values::array_get($payload, 'debugger_integration'), + 'flexUiStatusReport' => Values::array_get($payload, 'flex_ui_status_report'), + 'agentConvEndMethods' => Values::array_get($payload, 'agent_conv_end_methods'), + 'citrixVoiceVdi' => Values::array_get($payload, 'citrix_voice_vdi'), + 'offlineConfig' => Values::array_get($payload, 'offline_config'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfigurationInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the ConfigurationInstance + * + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): ConfigurationInstance + { + + return $this->proxy()->update(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationList.php new file mode 100644 index 0000000..a7e0452 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php new file mode 100644 index 0000000..48530ff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php @@ -0,0 +1,78 @@ +options['uiVersion'] = $uiVersion; + } + + /** + * The Pinned UI version of the Configuration resource to fetch. + * + * @param string $uiVersion The Pinned UI version of the Configuration resource to fetch. + * @return $this Fluent Builder + */ + public function setUiVersion(string $uiVersion): self + { + $this->options['uiVersion'] = $uiVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchConfigurationOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationPage.php new file mode 100644 index 0000000..eebbdb1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\FlexApi\V1\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php new file mode 100644 index 0000000..3ab83cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php @@ -0,0 +1,159 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/FlexFlows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlexFlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FlexFlowInstance + * + * @return FlexFlowInstance Fetched FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexFlowInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlexFlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlexFlowInstance + * + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Updated FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FlexFlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ChatServiceSid' => + $options['chatServiceSid'], + 'ChannelType' => + $options['channelType'], + 'ContactIdentity' => + $options['contactIdentity'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'IntegrationType' => + $options['integrationType'], + 'Integration.FlowSid' => + $options['integrationFlowSid'], + 'Integration.Url' => + $options['integrationUrl'], + 'Integration.WorkspaceSid' => + $options['integrationWorkspaceSid'], + 'Integration.WorkflowSid' => + $options['integrationWorkflowSid'], + 'Integration.Channel' => + $options['integrationChannel'], + 'Integration.Timeout' => + $options['integrationTimeout'], + 'Integration.Priority' => + $options['integrationPriority'], + 'Integration.CreationOnMessage' => + Serialize::booleanToString($options['integrationCreationOnMessage']), + 'LongLived' => + Serialize::booleanToString($options['longLived']), + 'JanitorEnabled' => + Serialize::booleanToString($options['janitorEnabled']), + 'Integration.RetryCount' => + $options['integrationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FlexFlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.FlexFlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php new file mode 100644 index 0000000..d068fa4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'channelType' => Values::array_get($payload, 'channel_type'), + 'contactIdentity' => Values::array_get($payload, 'contact_identity'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'integrationType' => Values::array_get($payload, 'integration_type'), + 'integration' => Values::array_get($payload, 'integration'), + 'longLived' => Values::array_get($payload, 'long_lived'), + 'janitorEnabled' => Values::array_get($payload, 'janitor_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlexFlowContext Context for this FlexFlowInstance + */ + protected function proxy(): FlexFlowContext + { + if (!$this->context) { + $this->context = new FlexFlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlexFlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlexFlowInstance + * + * @return FlexFlowInstance Fetched FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexFlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlexFlowInstance + * + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Updated FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FlexFlowInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.FlexFlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowList.php new file mode 100644 index 0000000..c35e0c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowList.php @@ -0,0 +1,232 @@ +solution = [ + ]; + + $this->uri = '/FlexFlows'; + } + + /** + * Create the FlexFlowInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @param string $chatServiceSid The SID of the chat service. + * @param string $channelType + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Created FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $chatServiceSid, string $channelType, array $options = []): FlexFlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'ChatServiceSid' => + $chatServiceSid, + 'ChannelType' => + $channelType, + 'ContactIdentity' => + $options['contactIdentity'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'IntegrationType' => + $options['integrationType'], + 'Integration.FlowSid' => + $options['integrationFlowSid'], + 'Integration.Url' => + $options['integrationUrl'], + 'Integration.WorkspaceSid' => + $options['integrationWorkspaceSid'], + 'Integration.WorkflowSid' => + $options['integrationWorkflowSid'], + 'Integration.Channel' => + $options['integrationChannel'], + 'Integration.Timeout' => + $options['integrationTimeout'], + 'Integration.Priority' => + $options['integrationPriority'], + 'Integration.CreationOnMessage' => + Serialize::booleanToString($options['integrationCreationOnMessage']), + 'LongLived' => + Serialize::booleanToString($options['longLived']), + 'JanitorEnabled' => + Serialize::booleanToString($options['janitorEnabled']), + 'Integration.RetryCount' => + $options['integrationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FlexFlowInstance( + $this->version, + $payload + ); + } + + + /** + * Reads FlexFlowInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FlexFlowInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams FlexFlowInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlexFlowInstance 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 FlexFlowPage Page of FlexFlowInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlexFlowPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlexFlowPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlexFlowInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlexFlowPage Page of FlexFlowInstance + */ + public function getPage(string $targetUrl): FlexFlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlexFlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlexFlowContext + * + * @param string $sid The SID of the Flex Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlexFlowContext + { + return new FlexFlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.FlexFlowList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php new file mode 100644 index 0000000..8c58c31 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php @@ -0,0 +1,700 @@ +options['contactIdentity'] = $contactIdentity; + $this->options['enabled'] = $enabled; + $this->options['integrationType'] = $integrationType; + $this->options['integrationFlowSid'] = $integrationFlowSid; + $this->options['integrationUrl'] = $integrationUrl; + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + $this->options['integrationChannel'] = $integrationChannel; + $this->options['integrationTimeout'] = $integrationTimeout; + $this->options['integrationPriority'] = $integrationPriority; + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + $this->options['longLived'] = $longLived; + $this->options['janitorEnabled'] = $janitorEnabled; + $this->options['integrationRetryCount'] = $integrationRetryCount; + } + + /** + * The channel contact's Identity. + * + * @param string $contactIdentity The channel contact's Identity. + * @return $this Fluent Builder + */ + public function setContactIdentity(string $contactIdentity): self + { + $this->options['contactIdentity'] = $contactIdentity; + return $this; + } + + /** + * Whether the new Flex Flow is enabled. + * + * @param bool $enabled Whether the new Flex Flow is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * @param string $integrationType + * @return $this Fluent Builder + */ + public function setIntegrationType(string $integrationType): self + { + $this->options['integrationType'] = $integrationType; + return $this; + } + + /** + * The SID of the Studio Flow. Required when `integrationType` is `studio`. + * + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @return $this Fluent Builder + */ + public function setIntegrationFlowSid(string $integrationFlowSid): self + { + $this->options['integrationFlowSid'] = $integrationFlowSid; + return $this; + } + + /** + * The URL of the external webhook. Required when `integrationType` is `external`. + * + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @return $this Fluent Builder + */ + public function setIntegrationUrl(string $integrationUrl): self + { + $this->options['integrationUrl'] = $integrationUrl; + return $this; + } + + /** + * The Workspace SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self + { + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + return $this; + } + + /** + * The Workflow SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self + { + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + return $this; + } + + /** + * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @return $this Fluent Builder + */ + public function setIntegrationChannel(string $integrationChannel): self + { + $this->options['integrationChannel'] = $integrationChannel; + return $this; + } + + /** + * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationTimeout(int $integrationTimeout): self + { + $this->options['integrationTimeout'] = $integrationTimeout; + return $this; + } + + /** + * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationPriority(int $integrationPriority): self + { + $this->options['integrationPriority'] = $integrationPriority; + return $this; + } + + /** + * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @return $this Fluent Builder + */ + public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self + { + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + return $this; + } + + /** + * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setJanitorEnabled(bool $janitorEnabled): self + { + $this->options['janitorEnabled'] = $janitorEnabled; + return $this; + } + + /** + * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationRetryCount(int $integrationRetryCount): self + { + $this->options['integrationRetryCount'] = $integrationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateFlexFlowOptions ' . $options . ']'; + } +} + + + +class ReadFlexFlowOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Flex Flow resources to read. + * + * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadFlexFlowOptions ' . $options . ']'; + } +} + +class UpdateFlexFlowOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @param string $chatServiceSid The SID of the chat service. + * @param string $channelType + * @param string $contactIdentity The channel contact's Identity. + * @param bool $enabled Whether the new Flex Flow is enabled. + * @param string $integrationType + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $chatServiceSid = Values::NONE, + string $channelType = Values::NONE, + string $contactIdentity = Values::NONE, + bool $enabled = Values::BOOL_NONE, + string $integrationType = Values::NONE, + string $integrationFlowSid = Values::NONE, + string $integrationUrl = Values::NONE, + string $integrationWorkspaceSid = Values::NONE, + string $integrationWorkflowSid = Values::NONE, + string $integrationChannel = Values::NONE, + int $integrationTimeout = Values::INT_NONE, + int $integrationPriority = Values::INT_NONE, + bool $integrationCreationOnMessage = Values::BOOL_NONE, + bool $longLived = Values::BOOL_NONE, + bool $janitorEnabled = Values::BOOL_NONE, + int $integrationRetryCount = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['chatServiceSid'] = $chatServiceSid; + $this->options['channelType'] = $channelType; + $this->options['contactIdentity'] = $contactIdentity; + $this->options['enabled'] = $enabled; + $this->options['integrationType'] = $integrationType; + $this->options['integrationFlowSid'] = $integrationFlowSid; + $this->options['integrationUrl'] = $integrationUrl; + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + $this->options['integrationChannel'] = $integrationChannel; + $this->options['integrationTimeout'] = $integrationTimeout; + $this->options['integrationPriority'] = $integrationPriority; + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + $this->options['longLived'] = $longLived; + $this->options['janitorEnabled'] = $janitorEnabled; + $this->options['integrationRetryCount'] = $integrationRetryCount; + } + + /** + * A descriptive string that you create to describe the Flex Flow resource. + * + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the chat service. + * + * @param string $chatServiceSid The SID of the chat service. + * @return $this Fluent Builder + */ + public function setChatServiceSid(string $chatServiceSid): self + { + $this->options['chatServiceSid'] = $chatServiceSid; + return $this; + } + + /** + * @param string $channelType + * @return $this Fluent Builder + */ + public function setChannelType(string $channelType): self + { + $this->options['channelType'] = $channelType; + return $this; + } + + /** + * The channel contact's Identity. + * + * @param string $contactIdentity The channel contact's Identity. + * @return $this Fluent Builder + */ + public function setContactIdentity(string $contactIdentity): self + { + $this->options['contactIdentity'] = $contactIdentity; + return $this; + } + + /** + * Whether the new Flex Flow is enabled. + * + * @param bool $enabled Whether the new Flex Flow is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * @param string $integrationType + * @return $this Fluent Builder + */ + public function setIntegrationType(string $integrationType): self + { + $this->options['integrationType'] = $integrationType; + return $this; + } + + /** + * The SID of the Studio Flow. Required when `integrationType` is `studio`. + * + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @return $this Fluent Builder + */ + public function setIntegrationFlowSid(string $integrationFlowSid): self + { + $this->options['integrationFlowSid'] = $integrationFlowSid; + return $this; + } + + /** + * The URL of the external webhook. Required when `integrationType` is `external`. + * + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @return $this Fluent Builder + */ + public function setIntegrationUrl(string $integrationUrl): self + { + $this->options['integrationUrl'] = $integrationUrl; + return $this; + } + + /** + * The Workspace SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self + { + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + return $this; + } + + /** + * The Workflow SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self + { + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + return $this; + } + + /** + * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @return $this Fluent Builder + */ + public function setIntegrationChannel(string $integrationChannel): self + { + $this->options['integrationChannel'] = $integrationChannel; + return $this; + } + + /** + * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationTimeout(int $integrationTimeout): self + { + $this->options['integrationTimeout'] = $integrationTimeout; + return $this; + } + + /** + * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationPriority(int $integrationPriority): self + { + $this->options['integrationPriority'] = $integrationPriority; + return $this; + } + + /** + * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @return $this Fluent Builder + */ + public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self + { + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + return $this; + } + + /** + * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setJanitorEnabled(bool $janitorEnabled): self + { + $this->options['janitorEnabled'] = $janitorEnabled; + return $this; + } + + /** + * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationRetryCount(int $integrationRetryCount): self + { + $this->options['integrationRetryCount'] = $integrationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateFlexFlowOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowPage.php new file mode 100644 index 0000000..5b1cee1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlexFlowInstance \Twilio\Rest\FlexApi\V1\FlexFlowInstance + */ + public function buildInstance(array $payload): FlexFlowInstance + { + return new FlexFlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.FlexFlowPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php new file mode 100644 index 0000000..3b75afa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php @@ -0,0 +1,102 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assessmentSid' => Values::array_get($payload, 'assessment_sid'), + 'comment' => Values::array_get($payload, 'comment'), + 'offset' => Values::array_get($payload, 'offset'), + 'report' => Values::array_get($payload, 'report'), + 'weight' => Values::array_get($payload, 'weight'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'userName' => Values::array_get($payload, 'user_name'), + 'userEmail' => Values::array_get($payload, 'user_email'), + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php new file mode 100644 index 0000000..a479c08 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php @@ -0,0 +1,200 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Assessments/Comments'; + } + + /** + * Create the InsightsAssessmentsCommentInstance + * + * @param string $categoryId The ID of the category + * @param string $categoryName The name of the category + * @param string $comment The Assessment comment. + * @param string $segmentId The id of the segment. + * @param string $agentId The id of the agent. + * @param string $offset The offset + * @param array|Options $options Optional Arguments + * @return InsightsAssessmentsCommentInstance Created InsightsAssessmentsCommentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categoryId, string $categoryName, string $comment, string $segmentId, string $agentId, string $offset, array $options = []): InsightsAssessmentsCommentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategoryId' => + $categoryId, + 'CategoryName' => + $categoryName, + 'Comment' => + $comment, + 'SegmentId' => + $segmentId, + 'AgentId' => + $agentId, + 'Offset' => + $offset, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsAssessmentsCommentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsAssessmentsCommentInstance 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 InsightsAssessmentsCommentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsAssessmentsCommentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsAssessmentsCommentInstance 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 InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsAssessmentsCommentPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'AgentId' => + $options['agentId'], + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsAssessmentsCommentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance + */ + public function getPage(string $targetUrl): InsightsAssessmentsCommentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php new file mode 100644 index 0000000..6b7ffd5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php @@ -0,0 +1,164 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsAssessmentsCommentOptions ' . $options . ']'; + } +} + +class ReadInsightsAssessmentsCommentOptions extends Options + { + /** + * @param string $segmentId The id of the segment. + * @param string $agentId The id of the agent. + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $segmentId = Values::NONE, + string $agentId = Values::NONE, + string $authorization = Values::NONE + + ) { + $this->options['segmentId'] = $segmentId; + $this->options['agentId'] = $agentId; + $this->options['authorization'] = $authorization; + } + + /** + * The id of the segment. + * + * @param string $segmentId The id of the segment. + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The id of the agent. + * + * @param string $agentId The id of the agent. + * @return $this Fluent Builder + */ + public function setAgentId(string $agentId): self + { + $this->options['agentId'] = $agentId; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsAssessmentsCommentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php new file mode 100644 index 0000000..27fe5ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsAssessmentsCommentInstance \Twilio\Rest\FlexApi\V1\InsightsAssessmentsCommentInstance + */ + public function buildInstance(array $payload): InsightsAssessmentsCommentInstance + { + return new InsightsAssessmentsCommentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php new file mode 100644 index 0000000..204d4ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php @@ -0,0 +1,86 @@ +properties = [ + 'accountId' => Values::array_get($payload, 'account_id'), + 'conversationId' => Values::array_get($payload, 'conversation_id'), + 'segmentCount' => Values::array_get($payload, 'segment_count'), + 'segments' => Values::array_get($payload, 'segments'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php new file mode 100644 index 0000000..fa0da1e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/Insights/Conversations'; + } + + /** + * Reads InsightsConversationsInstance 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 InsightsConversationsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsConversationsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsConversationsInstance 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 InsightsConversationsPage Page of InsightsConversationsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsConversationsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsConversationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsConversationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsConversationsPage Page of InsightsConversationsInstance + */ + public function getPage(string $targetUrl): InsightsConversationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsConversationsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php new file mode 100644 index 0000000..8a44a96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php @@ -0,0 +1,94 @@ +options['segmentId'] = $segmentId; + $this->options['authorization'] = $authorization; + } + + /** + * Unique Id of the segment for which conversation details needs to be fetched + * + * @param string $segmentId Unique Id of the segment for which conversation details needs to be fetched + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsConversationsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php new file mode 100644 index 0000000..ca12f43 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsConversationsInstance \Twilio\Rest\FlexApi\V1\InsightsConversationsInstance + */ + public function buildInstance(array $payload): InsightsConversationsInstance + { + return new InsightsConversationsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php new file mode 100644 index 0000000..332e8b1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php @@ -0,0 +1,110 @@ +solution = [ + 'categorySid' => + $categorySid, + ]; + + $this->uri = '/Insights/QualityManagement/Categories/' . \rawurlencode($categorySid) + .''; + } + + /** + * Delete the InsightsQuestionnairesCategoryInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Update the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesCategoryInstance( + $this->version, + $payload, + $this->solution['categorySid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php new file mode 100644 index 0000000..16d4ed8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php @@ -0,0 +1,137 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'categorySid' => Values::array_get($payload, 'category_sid'), + 'name' => Values::array_get($payload, 'name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['categorySid' => $categorySid ?: $this->properties['categorySid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesCategoryContext Context for this InsightsQuestionnairesCategoryInstance + */ + protected function proxy(): InsightsQuestionnairesCategoryContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesCategoryContext( + $this->version, + $this->solution['categorySid'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesCategoryInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Update the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + return $this->proxy()->update($name, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php new file mode 100644 index 0000000..61b01c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php @@ -0,0 +1,193 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Categories'; + } + + /** + * Create the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Created InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesCategoryInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesCategoryInstance 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 InsightsQuestionnairesCategoryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesCategoryInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesCategoryInstance 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 InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesCategoryPage + { + + $params = Values::of([ + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesCategoryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesCategoryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesCategoryContext + * + * @param string $categorySid The SID of the category to be deleted + */ + public function getContext( + string $categorySid + + ): InsightsQuestionnairesCategoryContext + { + return new InsightsQuestionnairesCategoryContext( + $this->version, + $categorySid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php new file mode 100644 index 0000000..15d7a0e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php @@ -0,0 +1,232 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php new file mode 100644 index 0000000..5cdd763 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesCategoryInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesCategoryInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesCategoryInstance + { + return new InsightsQuestionnairesCategoryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php new file mode 100644 index 0000000..974e8dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php @@ -0,0 +1,140 @@ +solution = [ + 'questionnaireSid' => + $questionnaireSid, + ]; + + $this->uri = '/Insights/QualityManagement/Questionnaires/' . \rawurlencode($questionnaireSid) + .''; + } + + /** + * Delete the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload, + $this->solution['questionnaireSid'] + ); + } + + + /** + * Update the InsightsQuestionnairesInstance + * + * @param bool $active The flag to enable or disable questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $active, array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Active' => + Serialize::booleanToString($active), + 'Name' => + $options['name'], + 'Description' => + $options['description'], + 'QuestionSids' => + Serialize::map($options['questionSids'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload, + $this->solution['questionnaireSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php new file mode 100644 index 0000000..7b3216b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'questionnaireSid' => Values::array_get($payload, 'questionnaire_sid'), + 'name' => Values::array_get($payload, 'name'), + 'description' => Values::array_get($payload, 'description'), + 'active' => Values::array_get($payload, 'active'), + 'questions' => Values::array_get($payload, 'questions'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['questionnaireSid' => $questionnaireSid ?: $this->properties['questionnaireSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesContext Context for this InsightsQuestionnairesInstance + */ + protected function proxy(): InsightsQuestionnairesContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesContext( + $this->version, + $this->solution['questionnaireSid'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsQuestionnairesInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the InsightsQuestionnairesInstance + * + * @param bool $active The flag to enable or disable questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $active, array $options = []): InsightsQuestionnairesInstance + { + + return $this->proxy()->update($active, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php new file mode 100644 index 0000000..88d8d20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php @@ -0,0 +1,206 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Questionnaires'; + } + + /** + * Create the InsightsQuestionnairesInstance + * + * @param string $name The name of this questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Created InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $name, array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + 'Description' => + $options['description'], + 'Active' => + Serialize::booleanToString($options['active']), + 'QuestionSids' => + Serialize::map($options['questionSids'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesInstance 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 InsightsQuestionnairesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesInstance 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 InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesPage + { + $options = new Values($options); + + $params = Values::of([ + 'IncludeInactive' => + Serialize::booleanToString($options['includeInactive']), + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesContext + * + * @param string $questionnaireSid The SID of the questionnaire + */ + public function getContext( + string $questionnaireSid + + ): InsightsQuestionnairesContext + { + return new InsightsQuestionnairesContext( + $this->version, + $questionnaireSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php new file mode 100644 index 0000000..13bf9d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php @@ -0,0 +1,410 @@ +options['description'] = $description; + $this->options['active'] = $active; + $this->options['questionSids'] = $questionSids; + $this->options['authorization'] = $authorization; + } + + /** + * The description of this questionnaire + * + * @param string $description The description of this questionnaire + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The flag to enable or disable questionnaire + * + * @param bool $active The flag to enable or disable questionnaire + * @return $this Fluent Builder + */ + public function setActive(bool $active): self + { + $this->options['active'] = $active; + return $this; + } + + /** + * The list of questions sids under a questionnaire + * + * @param string[] $questionSids The list of questions sids under a questionnaire + * @return $this Fluent Builder + */ + public function setQuestionSids(array $questionSids): self + { + $this->options['questionSids'] = $questionSids; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class FetchInsightsQuestionnairesOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesOptions extends Options + { + /** + * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + bool $includeInactive = Values::BOOL_NONE, + string $authorization = Values::NONE + + ) { + $this->options['includeInactive'] = $includeInactive; + $this->options['authorization'] = $authorization; + } + + /** + * Flag indicating whether to include inactive questionnaires or not + * + * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not + * @return $this Fluent Builder + */ + public function setIncludeInactive(bool $includeInactive): self + { + $this->options['includeInactive'] = $includeInactive; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesOptions extends Options + { + /** + * @param string $name The name of this questionnaire + * @param string $description The description of this questionnaire + * @param string[] $questionSids The list of questions sids under a questionnaire + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $name = Values::NONE, + string $description = Values::NONE, + array $questionSids = Values::ARRAY_NONE, + string $authorization = Values::NONE + + ) { + $this->options['name'] = $name; + $this->options['description'] = $description; + $this->options['questionSids'] = $questionSids; + $this->options['authorization'] = $authorization; + } + + /** + * The name of this questionnaire + * + * @param string $name The name of this questionnaire + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * The description of this questionnaire + * + * @param string $description The description of this questionnaire + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The list of questions sids under a questionnaire + * + * @param string[] $questionSids The list of questions sids under a questionnaire + * @return $this Fluent Builder + */ + public function setQuestionSids(array $questionSids): self + { + $this->options['questionSids'] = $questionSids; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php new file mode 100644 index 0000000..49112a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesInstance + { + return new InsightsQuestionnairesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php new file mode 100644 index 0000000..d6158cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php @@ -0,0 +1,119 @@ +solution = [ + 'questionSid' => + $questionSid, + ]; + + $this->uri = '/Insights/QualityManagement/Questions/' . \rawurlencode($questionSid) + .''; + } + + /** + * Delete the InsightsQuestionnairesQuestionInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Update the InsightsQuestionnairesQuestionInstance + * + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AllowNa' => + Serialize::booleanToString($allowNa), + 'CategorySid' => + $options['categorySid'], + 'Question' => + $options['question'], + 'Description' => + $options['description'], + 'AnswerSetId' => + $options['answerSetId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesQuestionInstance( + $this->version, + $payload, + $this->solution['questionSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php new file mode 100644 index 0000000..ccfdae8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'questionSid' => Values::array_get($payload, 'question_sid'), + 'question' => Values::array_get($payload, 'question'), + 'description' => Values::array_get($payload, 'description'), + 'category' => Values::array_get($payload, 'category'), + 'answerSetId' => Values::array_get($payload, 'answer_set_id'), + 'allowNa' => Values::array_get($payload, 'allow_na'), + 'usage' => Values::array_get($payload, 'usage'), + 'answerSet' => Values::array_get($payload, 'answer_set'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['questionSid' => $questionSid ?: $this->properties['questionSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesQuestionContext Context for this InsightsQuestionnairesQuestionInstance + */ + protected function proxy(): InsightsQuestionnairesQuestionContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesQuestionContext( + $this->version, + $this->solution['questionSid'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesQuestionInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Update the InsightsQuestionnairesQuestionInstance + * + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + return $this->proxy()->update($allowNa, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php new file mode 100644 index 0000000..9279c92 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php @@ -0,0 +1,211 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Questions'; + } + + /** + * Create the InsightsQuestionnairesQuestionInstance + * + * @param string $categorySid The SID of the category + * @param string $question The question. + * @param string $answerSetId The answer_set for the question. + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Created InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categorySid, string $question, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategorySid' => + $categorySid, + 'Question' => + $question, + 'AnswerSetId' => + $answerSetId, + 'AllowNa' => + Serialize::booleanToString($allowNa), + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesQuestionInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesQuestionInstance 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 InsightsQuestionnairesQuestionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesQuestionInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesQuestionInstance 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 InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesQuestionPage + { + $options = new Values($options); + + $params = Values::of([ + 'CategorySid' => + Serialize::map($options['categorySid'], function ($e) { return $e; }), + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesQuestionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesQuestionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesQuestionContext + * + * @param string $questionSid The SID of the question + */ + public function getContext( + string $questionSid + + ): InsightsQuestionnairesQuestionContext + { + return new InsightsQuestionnairesQuestionContext( + $this->version, + $questionSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php new file mode 100644 index 0000000..1310ba7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php @@ -0,0 +1,340 @@ +options['description'] = $description; + $this->options['authorization'] = $authorization; + } + + /** + * The description for the question. + * + * @param string $description The description for the question. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $authorization = Values::NONE + + ) { + $this->options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string[] $categorySid The list of category SIDs + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + array $categorySid = Values::ARRAY_NONE, + string $authorization = Values::NONE + + ) { + $this->options['categorySid'] = $categorySid; + $this->options['authorization'] = $authorization; + } + + /** + * The list of category SIDs + * + * @param string[] $categorySid The list of category SIDs + * @return $this Fluent Builder + */ + public function setCategorySid(array $categorySid): self + { + $this->options['categorySid'] = $categorySid; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string $categorySid The SID of the category + * @param string $question The question. + * @param string $description The description for the question. + * @param string $answerSetId The answer_set for the question. + * @param string $authorization The Authorization HTTP request header + */ + public function __construct( + + string $categorySid = Values::NONE, + string $question = Values::NONE, + string $description = Values::NONE, + string $answerSetId = Values::NONE, + string $authorization = Values::NONE + + ) { + $this->options['categorySid'] = $categorySid; + $this->options['question'] = $question; + $this->options['description'] = $description; + $this->options['answerSetId'] = $answerSetId; + $this->options['authorization'] = $authorization; + } + + /** + * The SID of the category + * + * @param string $categorySid The SID of the category + * @return $this Fluent Builder + */ + public function setCategorySid(string $categorySid): self + { + $this->options['categorySid'] = $categorySid; + return $this; + } + + /** + * The question. + * + * @param string $question The question. + * @return $this Fluent Builder + */ + public function setQuestion(string $question): self + { + $this->options['question'] = $question; + return $this; + } + + /** + * The description for the question. + * + * @param string $description The description for the question. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The answer_set for the question. + * + * @param string $answerSetId The answer_set for the question. + * @return $this Fluent Builder + */ + public function setAnswerSetId(string $answerSetId): self + { + $this->options['answerSetId'] = $answerSetId; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php new file mode 100644 index 0000000..03b9223 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesQuestionInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesQuestionInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesQuestionInstance + { + return new InsightsQuestionnairesQuestionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php new file mode 100644 index 0000000..e934208 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php @@ -0,0 +1,122 @@ +properties = [ + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'externalId' => Values::array_get($payload, 'external_id'), + 'queue' => Values::array_get($payload, 'queue'), + 'externalContact' => Values::array_get($payload, 'external_contact'), + 'externalSegmentLinkId' => Values::array_get($payload, 'external_segment_link_id'), + 'date' => Values::array_get($payload, 'date'), + 'accountId' => Values::array_get($payload, 'account_id'), + 'externalSegmentLink' => Values::array_get($payload, 'external_segment_link'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'agentPhone' => Values::array_get($payload, 'agent_phone'), + 'agentName' => Values::array_get($payload, 'agent_name'), + 'agentTeamName' => Values::array_get($payload, 'agent_team_name'), + 'agentTeamNameInHierarchy' => Values::array_get($payload, 'agent_team_name_in_hierarchy'), + 'agentLink' => Values::array_get($payload, 'agent_link'), + 'customerPhone' => Values::array_get($payload, 'customer_phone'), + 'customerName' => Values::array_get($payload, 'customer_name'), + 'customerLink' => Values::array_get($payload, 'customer_link'), + 'segmentRecordingOffset' => Values::array_get($payload, 'segment_recording_offset'), + 'media' => Values::array_get($payload, 'media'), + 'assessmentType' => Values::array_get($payload, 'assessment_type'), + 'assessmentPercentage' => Values::array_get($payload, 'assessment_percentage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSegmentsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php new file mode 100644 index 0000000..15b0bff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php @@ -0,0 +1,157 @@ +solution = [ + ]; + + $this->uri = '/Insights/Segments'; + } + + /** + * Reads InsightsSegmentsInstance 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 InsightsSegmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsSegmentsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsSegmentsInstance 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 InsightsSegmentsPage Page of InsightsSegmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsSegmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'ReservationId' => + Serialize::map($options['reservationId'], function ($e) { return $e; }), + 'Authorization' => + $options['authorization'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsSegmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsSegmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsSegmentsPage Page of InsightsSegmentsInstance + */ + public function getPage(string $targetUrl): InsightsSegmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsSegmentsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSegmentsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php new file mode 100644 index 0000000..11e5235 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php @@ -0,0 +1,112 @@ +options['segmentId'] = $segmentId; + $this->options['reservationId'] = $reservationId; + $this->options['authorization'] = $authorization; + } + + /** + * To unique id of the segment + * + * @param string $segmentId To unique id of the segment + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The list of reservation Ids + * + * @param string[] $reservationId The list of reservation Ids + * @return $this Fluent Builder + */ + public function setReservationId(array $reservationId): self + { + $this->options['reservationId'] = $reservationId; + return $this; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsSegmentsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php new file mode 100644 index 0000000..8f82bcd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSegmentsInstance \Twilio\Rest\FlexApi\V1\InsightsSegmentsInstance + */ + public function buildInstance(array $payload): InsightsSegmentsInstance + { + return new InsightsSegmentsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSegmentsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php new file mode 100644 index 0000000..30b6ee5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php @@ -0,0 +1,81 @@ +solution = [ + ]; + + $this->uri = '/Insights/Session'; + } + + /** + * Create the InsightsSessionInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSessionInstance Created InsightsSessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): InsightsSessionInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new InsightsSessionInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSessionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php new file mode 100644 index 0000000..e4b6b55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'workspaceId' => Values::array_get($payload, 'workspace_id'), + 'sessionExpiry' => Values::array_get($payload, 'session_expiry'), + 'sessionId' => Values::array_get($payload, 'session_id'), + 'baseUrl' => Values::array_get($payload, 'base_url'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsSessionContext Context for this InsightsSessionInstance + */ + protected function proxy(): InsightsSessionContext + { + if (!$this->context) { + $this->context = new InsightsSessionContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the InsightsSessionInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSessionInstance Created InsightsSessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): InsightsSessionInstance + { + + return $this->proxy()->create($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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSessionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionList.php new file mode 100644 index 0000000..fc2f9f9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a InsightsSessionContext + */ + public function getContext( + + ): InsightsSessionContext + { + return new InsightsSessionContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSessionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php new file mode 100644 index 0000000..c9e2ec0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsSessionOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php new file mode 100644 index 0000000..761b7a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSessionInstance \Twilio\Rest\FlexApi\V1\InsightsSessionInstance + */ + public function buildInstance(array $payload): InsightsSessionInstance + { + return new InsightsSessionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSessionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php new file mode 100644 index 0000000..c5b4052 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'answerSets' => Values::array_get($payload, 'answer_sets'), + 'answerSetCategories' => Values::array_get($payload, 'answer_set_categories'), + 'notApplicable' => Values::array_get($payload, 'not_applicable'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php new file mode 100644 index 0000000..9c28999 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php @@ -0,0 +1,76 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Settings/AnswerSets'; + } + + /** + * Fetch the InsightsSettingsAnswerSetsInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSettingsAnswerSetsInstance Fetched InsightsSettingsAnswerSetsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSettingsAnswerSetsInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsSettingsAnswerSetsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php new file mode 100644 index 0000000..b5b2e0c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsSettingsAnswerSetsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php new file mode 100644 index 0000000..b9676b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSettingsAnswerSetsInstance \Twilio\Rest\FlexApi\V1\InsightsSettingsAnswerSetsInstance + */ + public function buildInstance(array $payload): InsightsSettingsAnswerSetsInstance + { + return new InsightsSettingsAnswerSetsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php new file mode 100644 index 0000000..cc84640 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php @@ -0,0 +1,84 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'comments' => Values::array_get($payload, 'comments'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php new file mode 100644 index 0000000..8f87a78 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php @@ -0,0 +1,76 @@ +solution = [ + ]; + + $this->uri = '/Insights/QualityManagement/Settings/CommentTags'; + } + + /** + * Fetch the InsightsSettingsCommentInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSettingsCommentInstance Fetched InsightsSettingsCommentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSettingsCommentInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsSettingsCommentInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php new file mode 100644 index 0000000..b97d097 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsSettingsCommentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php new file mode 100644 index 0000000..01cecb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSettingsCommentInstance \Twilio\Rest\FlexApi\V1\InsightsSettingsCommentInstance + */ + public function buildInstance(array $payload): InsightsSettingsCommentInstance + { + return new InsightsSettingsCommentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php new file mode 100644 index 0000000..ccd725c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php @@ -0,0 +1,81 @@ +solution = [ + ]; + + $this->uri = '/Insights/UserRoles'; + } + + /** + * Fetch the InsightsUserRolesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsUserRolesInstance Fetched InsightsUserRolesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsUserRolesInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Authorization' => $options['authorization']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsUserRolesInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsUserRolesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php new file mode 100644 index 0000000..a62ab10 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php @@ -0,0 +1,117 @@ +properties = [ + 'roles' => Values::array_get($payload, 'roles'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsUserRolesContext Context for this InsightsUserRolesInstance + */ + protected function proxy(): InsightsUserRolesContext + { + if (!$this->context) { + $this->context = new InsightsUserRolesContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the InsightsUserRolesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsUserRolesInstance Fetched InsightsUserRolesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsUserRolesInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsUserRolesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php new file mode 100644 index 0000000..f491b39 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a InsightsUserRolesContext + */ + public function getContext( + + ): InsightsUserRolesContext + { + return new InsightsUserRolesContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsUserRolesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php new file mode 100644 index 0000000..fec566a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsUserRolesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php new file mode 100644 index 0000000..a32d46e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsUserRolesInstance \Twilio\Rest\FlexApi\V1\InsightsUserRolesInstance + */ + public function buildInstance(array $payload): InsightsUserRolesInstance + { + return new InsightsUserRolesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsUserRolesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php new file mode 100644 index 0000000..e91b30e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php @@ -0,0 +1,90 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'routing' => Values::array_get($payload, 'routing'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, 'channelSid' => $channelSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInviteInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php new file mode 100644 index 0000000..172f3d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php @@ -0,0 +1,186 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InteractionChannelInviteInstance + * + * @param array $routing The Interaction's routing logic. + * @return InteractionChannelInviteInstance Created InteractionChannelInviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $routing): InteractionChannelInviteInstance + { + + $data = Values::of([ + 'Routing' => + Serialize::jsonObject($routing), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InteractionChannelInviteInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InteractionChannelInviteInstance 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 InteractionChannelInviteInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelInviteInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelInviteInstance 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 InteractionChannelInvitePage Page of InteractionChannelInviteInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelInvitePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelInvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelInviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelInvitePage Page of InteractionChannelInviteInstance + */ + public function getPage(string $targetUrl): InteractionChannelInvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelInvitePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInviteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php new file mode 100644 index 0000000..48fe45d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelInviteInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelInviteInstance + */ + public function buildInstance(array $payload): InteractionChannelInviteInstance + { + return new InteractionChannelInviteInstance($this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInvitePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php new file mode 100644 index 0000000..c9b435c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php @@ -0,0 +1,101 @@ +solution = [ + 'interactionSid' => + $interactionSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Update the InteractionChannelParticipantInstance + * + * @param string $status + * @return InteractionChannelParticipantInstance Updated InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): InteractionChannelParticipantInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InteractionChannelParticipantInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php new file mode 100644 index 0000000..673d300 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php @@ -0,0 +1,130 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'type' => Values::array_get($payload, 'type'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'url' => Values::array_get($payload, 'url'), + 'routingProperties' => Values::array_get($payload, 'routing_properties'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, '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 InteractionChannelParticipantContext Context for this InteractionChannelParticipantInstance + */ + protected function proxy(): InteractionChannelParticipantContext + { + if (!$this->context) { + $this->context = new InteractionChannelParticipantContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the InteractionChannelParticipantInstance + * + * @param string $status + * @return InteractionChannelParticipantInstance Updated InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): InteractionChannelParticipantInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php new file mode 100644 index 0000000..79df145 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php @@ -0,0 +1,213 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Participants'; + } + + /** + * Create the InteractionChannelParticipantInstance + * + * @param string $type + * @param array $mediaProperties JSON representing the Media Properties for the new Participant. + * @param array|Options $options Optional Arguments + * @return InteractionChannelParticipantInstance Created InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $mediaProperties, array $options = []): InteractionChannelParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'MediaProperties' => + Serialize::jsonObject($mediaProperties), + 'RoutingProperties' => + Serialize::jsonObject($options['routingProperties']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InteractionChannelParticipantInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InteractionChannelParticipantInstance 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 InteractionChannelParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelParticipantInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelParticipantInstance 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 InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance + */ + public function getPage(string $targetUrl): InteractionChannelParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionChannelParticipantContext + * + * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource. + */ + public function getContext( + string $sid + + ): InteractionChannelParticipantContext + { + return new InteractionChannelParticipantContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.php new file mode 100644 index 0000000..8fb01f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantOptions.php @@ -0,0 +1,80 @@ +options['routingProperties'] = $routingProperties; + } + + /** + * Object representing the Routing Properties for the new Participant. + * + * @param array $routingProperties Object representing the Routing Properties for the new Participant. + * @return $this Fluent Builder + */ + public function setRoutingProperties(array $routingProperties): self + { + $this->options['routingProperties'] = $routingProperties; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInteractionChannelParticipantOptions ' . $options . ']'; + } +} + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php new file mode 100644 index 0000000..d64e793 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelParticipantInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelParticipantInstance + */ + public function buildInstance(array $payload): InteractionChannelParticipantInstance + { + return new InteractionChannelParticipantInstance($this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php new file mode 100644 index 0000000..d353768 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php @@ -0,0 +1,201 @@ +solution = [ + 'interactionSid' => + $interactionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InteractionChannelInstance + * + * @return InteractionChannelInstance Fetched InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InteractionChannelInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the InteractionChannelInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return InteractionChannelInstance Updated InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): InteractionChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'Routing' => + Serialize::jsonObject($options['routing']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InteractionChannelInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): InteractionChannelParticipantList + { + if (!$this->_participants) { + $this->_participants = new InteractionChannelParticipantList( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the invites + */ + protected function getInvites(): InteractionChannelInviteList + { + if (!$this->_invites) { + $this->_invites = new InteractionChannelInviteList( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php new file mode 100644 index 0000000..6ded2f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'type' => Values::array_get($payload, 'type'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionChannelContext Context for this InteractionChannelInstance + */ + protected function proxy(): InteractionChannelContext + { + if (!$this->context) { + $this->context = new InteractionChannelContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InteractionChannelInstance + * + * @return InteractionChannelInstance Fetched InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InteractionChannelInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return InteractionChannelInstance Updated InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): InteractionChannelInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Access the participants + */ + protected function getParticipants(): InteractionChannelParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the invites + */ + protected function getInvites(): InteractionChannelInviteList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php new file mode 100644 index 0000000..9d3e1ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php @@ -0,0 +1,168 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels'; + } + + /** + * Reads InteractionChannelInstance 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 InteractionChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelInstance 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 InteractionChannelPage Page of InteractionChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelPage Page of InteractionChannelInstance + */ + public function getPage(string $targetUrl): InteractionChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionChannelContext + * + * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO. + */ + public function getContext( + string $sid + + ): InteractionChannelContext + { + return new InteractionChannelContext( + $this->version, + $this->solution['interactionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php new file mode 100644 index 0000000..3214e14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php @@ -0,0 +1,80 @@ +options['routing'] = $routing; + } + + /** + * It changes the state of associated tasks. Routing status is required, When the channel status is set to `inactive`. Allowed Value for routing status is `closed`. Otherwise Optional, if not specified, all tasks will be set to `wrapping`. + * + * @param array $routing It changes the state of associated tasks. Routing status is required, When the channel status is set to `inactive`. Allowed Value for routing status is `closed`. Otherwise Optional, if not specified, all tasks will be set to `wrapping`. + * @return $this Fluent Builder + */ + public function setRouting(array $routing): self + { + $this->options['routing'] = $routing; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInteractionChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php new file mode 100644 index 0000000..a37729a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannelInstance + */ + public function buildInstance(array $payload): InteractionChannelInstance + { + return new InteractionChannelInstance($this->version, $payload, $this->solution['interactionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionContext.php new file mode 100644 index 0000000..1d6a26e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InteractionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): InteractionChannelList + { + if (!$this->_channels) { + $this->_channels = new InteractionChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionInstance.php new file mode 100644 index 0000000..abf340f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'channel' => Values::array_get($payload, 'channel'), + 'routing' => Values::array_get($payload, 'routing'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'interactionContextSid' => Values::array_get($payload, 'interaction_context_sid'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionContext Context for this InteractionInstance + */ + protected function proxy(): InteractionContext + { + if (!$this->context) { + $this->context = new InteractionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the channels + */ + protected function getChannels(): InteractionChannelList + { + return $this->proxy()->channels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionList.php new file mode 100644 index 0000000..e9ed4c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionList.php @@ -0,0 +1,103 @@ +solution = [ + ]; + + $this->uri = '/Interactions'; + } + + /** + * Create the InteractionInstance + * + * @param array $channel The Interaction's channel. + * @param array|Options $options Optional Arguments + * @return InteractionInstance Created InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $channel, array $options = []): InteractionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Channel' => + Serialize::jsonObject($channel), + 'Routing' => + Serialize::jsonObject($options['routing']), + 'InteractionContextSid' => + $options['interactionContextSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InteractionInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a InteractionContext + * + * @param string $sid The SID of the Interaction resource to fetch. + */ + public function getContext( + string $sid + + ): InteractionContext + { + return new InteractionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionOptions.php new file mode 100644 index 0000000..70d3788 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionOptions.php @@ -0,0 +1,96 @@ +options['routing'] = $routing; + $this->options['interactionContextSid'] = $interactionContextSid; + } + + /** + * The Interaction's routing logic. + * + * @param array $routing The Interaction's routing logic. + * @return $this Fluent Builder + */ + public function setRouting(array $routing): self + { + $this->options['routing'] = $routing; + return $this; + } + + /** + * The Interaction context sid is used for adding a context lookup sid + * + * @param string $interactionContextSid The Interaction context sid is used for adding a context lookup sid + * @return $this Fluent Builder + */ + public function setInteractionContextSid(string $interactionContextSid): self + { + $this->options['interactionContextSid'] = $interactionContextSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInteractionOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionPage.php new file mode 100644 index 0000000..8c5265e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/InteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionInstance \Twilio\Rest\FlexApi\V1\InteractionInstance + */ + public function buildInstance(array $payload): InteractionInstance + { + return new InteractionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsContext.php new file mode 100644 index 0000000..be6c48b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsContext.php @@ -0,0 +1,93 @@ +solution = [ + 'pluginSid' => + $pluginSid, + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Plugins/' . \rawurlencode($pluginSid) + .'/Versions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PluginVersionsInstance + * + * @param array|Options $options Optional Arguments + * @return PluginVersionsInstance Fetched PluginVersionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginVersionsInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PluginVersionsInstance( + $this->version, + $payload, + $this->solution['pluginSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginVersionsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsInstance.php new file mode 100644 index 0000000..89a9ff3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'pluginSid' => Values::array_get($payload, 'plugin_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'version' => Values::array_get($payload, 'version'), + 'pluginUrl' => Values::array_get($payload, 'plugin_url'), + 'changelog' => Values::array_get($payload, 'changelog'), + 'private' => Values::array_get($payload, 'private'), + 'archived' => Values::array_get($payload, 'archived'), + 'validated' => Values::array_get($payload, 'validated'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['pluginSid' => $pluginSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginVersionsContext Context for this PluginVersionsInstance + */ + protected function proxy(): PluginVersionsContext + { + if (!$this->context) { + $this->context = new PluginVersionsContext( + $this->version, + $this->solution['pluginSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PluginVersionsInstance + * + * @param array|Options $options Optional Arguments + * @return PluginVersionsInstance Fetched PluginVersionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginVersionsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginVersionsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsList.php new file mode 100644 index 0000000..eff34f2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsList.php @@ -0,0 +1,213 @@ +solution = [ + 'pluginSid' => + $pluginSid, + + ]; + + $this->uri = '/PluginService/Plugins/' . \rawurlencode($pluginSid) + .'/Versions'; + } + + /** + * Create the PluginVersionsInstance + * + * @param string $version The Flex Plugin Version's version. + * @param string $pluginUrl The URL of the Flex Plugin Version bundle + * @param array|Options $options Optional Arguments + * @return PluginVersionsInstance Created PluginVersionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $version, string $pluginUrl, array $options = []): PluginVersionsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Version' => + $version, + 'PluginUrl' => + $pluginUrl, + 'Changelog' => + $options['changelog'], + 'Private' => + Serialize::booleanToString($options['_private']), + 'CliVersion' => + $options['cliVersion'], + 'ValidateStatus' => + $options['validateStatus'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PluginVersionsInstance( + $this->version, + $payload, + $this->solution['pluginSid'] + ); + } + + + /** + * Reads PluginVersionsInstance 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 PluginVersionsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PluginVersionsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PluginVersionsInstance 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 PluginVersionsPage Page of PluginVersionsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PluginVersionsPage + { + + $params = Values::of([ + 'Flex-Metadata' => + $options['flexMetadata'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PluginVersionsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PluginVersionsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PluginVersionsPage Page of PluginVersionsInstance + */ + public function getPage(string $targetUrl): PluginVersionsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PluginVersionsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PluginVersionsContext + * + * @param string $sid The SID of the Flex Plugin Version resource to fetch. + */ + public function getContext( + string $sid + + ): PluginVersionsContext + { + return new PluginVersionsContext( + $this->version, + $this->solution['pluginSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginVersionsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsOptions.php new file mode 100644 index 0000000..54af0dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsOptions.php @@ -0,0 +1,253 @@ +options['changelog'] = $changelog; + $this->options['private'] = $private; + $this->options['cliVersion'] = $cliVersion; + $this->options['validateStatus'] = $validateStatus; + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The changelog of the Flex Plugin Version. + * + * @param string $changelog The changelog of the Flex Plugin Version. + * @return $this Fluent Builder + */ + public function setChangelog(string $changelog): self + { + $this->options['changelog'] = $changelog; + return $this; + } + + /** + * Whether this Flex Plugin Version requires authorization. + * + * @param bool $private Whether this Flex Plugin Version requires authorization. + * @return $this Fluent Builder + */ + public function setPrivate(bool $private): self + { + $this->options['private'] = $private; + return $this; + } + + /** + * The version of Flex Plugins CLI used to create this plugin + * + * @param string $cliVersion The version of Flex Plugins CLI used to create this plugin + * @return $this Fluent Builder + */ + public function setCliVersion(string $cliVersion): self + { + $this->options['cliVersion'] = $cliVersion; + return $this; + } + + /** + * The validation status of the plugin, indicating whether it has been validated + * + * @param string $validateStatus The validation status of the plugin, indicating whether it has been validated + * @return $this Fluent Builder + */ + public function setValidateStatus(string $validateStatus): self + { + $this->options['validateStatus'] = $validateStatus; + return $this; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreatePluginVersionsOptions ' . $options . ']'; + } +} + +class FetchPluginVersionsOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchPluginVersionsOptions ' . $options . ']'; + } +} + +class ReadPluginVersionsOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadPluginVersionsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsPage.php new file mode 100644 index 0000000..f33cbfc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/Plugin/PluginVersionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginVersionsInstance \Twilio\Rest\FlexApi\V1\Plugin\PluginVersionsInstance + */ + public function buildInstance(array $payload): PluginVersionsInstance + { + return new PluginVersionsInstance($this->version, $payload, $this->solution['pluginSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginVersionsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveContext.php new file mode 100644 index 0000000..b4d0f48 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveContext.php @@ -0,0 +1,87 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Plugins/' . \rawurlencode($sid) + .'/Archive'; + } + + /** + * Update the PluginArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginArchiveInstance Updated PluginArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginArchiveInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new PluginArchiveInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginArchiveContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveInstance.php new file mode 100644 index 0000000..66ac0ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'archived' => Values::array_get($payload, 'archived'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginArchiveContext Context for this PluginArchiveInstance + */ + protected function proxy(): PluginArchiveContext + { + if (!$this->context) { + $this->context = new PluginArchiveContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the PluginArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginArchiveInstance Updated PluginArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginArchiveInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginArchiveInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveList.php new file mode 100644 index 0000000..75122ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PluginArchiveContext + * + * @param string $sid The SID of the Flex Plugin resource to archive. + */ + public function getContext( + string $sid + + ): PluginArchiveContext + { + return new PluginArchiveContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginArchiveList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveOptions.php new file mode 100644 index 0000000..a01c32d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchiveOptions.php @@ -0,0 +1,76 @@ +options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdatePluginArchiveOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchivePage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchivePage.php new file mode 100644 index 0000000..f4596f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginArchivePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginArchiveInstance \Twilio\Rest\FlexApi\V1\PluginArchiveInstance + */ + public function buildInstance(array $payload): PluginArchiveInstance + { + return new PluginArchiveInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginArchivePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginContext.php new file mode 100644 index 0000000..5ed67c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginContext.php @@ -0,0 +1,93 @@ +solution = [ + 'configurationSid' => + $configurationSid, + 'pluginSid' => + $pluginSid, + ]; + + $this->uri = '/PluginService/Configurations/' . \rawurlencode($configurationSid) + .'/Plugins/' . \rawurlencode($pluginSid) + .''; + } + + /** + * Fetch the ConfiguredPluginInstance + * + * @param array|Options $options Optional Arguments + * @return ConfiguredPluginInstance Fetched ConfiguredPluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfiguredPluginInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConfiguredPluginInstance( + $this->version, + $payload, + $this->solution['configurationSid'], + $this->solution['pluginSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfiguredPluginContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginInstance.php new file mode 100644 index 0000000..6ad3b88 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'configurationSid' => Values::array_get($payload, 'configuration_sid'), + 'pluginSid' => Values::array_get($payload, 'plugin_sid'), + 'pluginVersionSid' => Values::array_get($payload, 'plugin_version_sid'), + 'phase' => Values::array_get($payload, 'phase'), + 'pluginUrl' => Values::array_get($payload, 'plugin_url'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'pluginArchived' => Values::array_get($payload, 'plugin_archived'), + 'version' => Values::array_get($payload, 'version'), + 'changelog' => Values::array_get($payload, 'changelog'), + 'pluginVersionArchived' => Values::array_get($payload, 'plugin_version_archived'), + 'private' => Values::array_get($payload, 'private'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['configurationSid' => $configurationSid, 'pluginSid' => $pluginSid ?: $this->properties['pluginSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfiguredPluginContext Context for this ConfiguredPluginInstance + */ + protected function proxy(): ConfiguredPluginContext + { + if (!$this->context) { + $this->context = new ConfiguredPluginContext( + $this->version, + $this->solution['configurationSid'], + $this->solution['pluginSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConfiguredPluginInstance + * + * @param array|Options $options Optional Arguments + * @return ConfiguredPluginInstance Fetched ConfiguredPluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfiguredPluginInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfiguredPluginInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginList.php new file mode 100644 index 0000000..2b59312 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginList.php @@ -0,0 +1,170 @@ +solution = [ + 'configurationSid' => + $configurationSid, + + ]; + + $this->uri = '/PluginService/Configurations/' . \rawurlencode($configurationSid) + .'/Plugins'; + } + + /** + * Reads ConfiguredPluginInstance 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 ConfiguredPluginInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConfiguredPluginInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConfiguredPluginInstance 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 ConfiguredPluginPage Page of ConfiguredPluginInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConfiguredPluginPage + { + + $params = Values::of([ + 'Flex-Metadata' => + $options['flexMetadata'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConfiguredPluginPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConfiguredPluginInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConfiguredPluginPage Page of ConfiguredPluginInstance + */ + public function getPage(string $targetUrl): ConfiguredPluginPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConfiguredPluginPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConfiguredPluginContext + * + * @param string $pluginSid The unique string that we created to identify the Flex Plugin resource. + */ + public function getContext( + string $pluginSid + + ): ConfiguredPluginContext + { + return new ConfiguredPluginContext( + $this->version, + $this->solution['configurationSid'], + $pluginSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfiguredPluginList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginOptions.php new file mode 100644 index 0000000..8869c20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginOptions.php @@ -0,0 +1,128 @@ +options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchConfiguredPluginOptions ' . $options . ']'; + } +} + +class ReadConfiguredPluginOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadConfiguredPluginOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginPage.php new file mode 100644 index 0000000..2643f85 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfiguration/ConfiguredPluginPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfiguredPluginInstance \Twilio\Rest\FlexApi\V1\PluginConfiguration\ConfiguredPluginInstance + */ + public function buildInstance(array $payload): ConfiguredPluginInstance + { + return new ConfiguredPluginInstance($this->version, $payload, $this->solution['configurationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfiguredPluginPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveContext.php new file mode 100644 index 0000000..f0efbc0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveContext.php @@ -0,0 +1,87 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Configurations/' . \rawurlencode($sid) + .'/Archive'; + } + + /** + * Update the PluginConfigurationArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginConfigurationArchiveInstance Updated PluginConfigurationArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginConfigurationArchiveInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new PluginConfigurationArchiveInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginConfigurationArchiveContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveInstance.php new file mode 100644 index 0000000..e553762 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveInstance.php @@ -0,0 +1,130 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'name' => Values::array_get($payload, 'name'), + 'description' => Values::array_get($payload, 'description'), + 'archived' => Values::array_get($payload, 'archived'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginConfigurationArchiveContext Context for this PluginConfigurationArchiveInstance + */ + protected function proxy(): PluginConfigurationArchiveContext + { + if (!$this->context) { + $this->context = new PluginConfigurationArchiveContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the PluginConfigurationArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginConfigurationArchiveInstance Updated PluginConfigurationArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginConfigurationArchiveInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginConfigurationArchiveInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveList.php new file mode 100644 index 0000000..79f7087 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PluginConfigurationArchiveContext + * + * @param string $sid The SID of the Flex Plugin Configuration resource to archive. + */ + public function getContext( + string $sid + + ): PluginConfigurationArchiveContext + { + return new PluginConfigurationArchiveContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginConfigurationArchiveList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveOptions.php new file mode 100644 index 0000000..ba7a2e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchiveOptions.php @@ -0,0 +1,76 @@ +options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdatePluginConfigurationArchiveOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchivePage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchivePage.php new file mode 100644 index 0000000..8cdfd62 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationArchivePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginConfigurationArchiveInstance \Twilio\Rest\FlexApi\V1\PluginConfigurationArchiveInstance + */ + public function buildInstance(array $payload): PluginConfigurationArchiveInstance + { + return new PluginConfigurationArchiveInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginConfigurationArchivePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationContext.php new file mode 100644 index 0000000..8108a36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationContext.php @@ -0,0 +1,145 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Configurations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PluginConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return PluginConfigurationInstance Fetched PluginConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginConfigurationInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PluginConfigurationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the plugins + */ + protected function getPlugins(): ConfiguredPluginList + { + if (!$this->_plugins) { + $this->_plugins = new ConfiguredPluginList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_plugins; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationInstance.php new file mode 100644 index 0000000..8993687 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationInstance.php @@ -0,0 +1,143 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'name' => Values::array_get($payload, 'name'), + 'description' => Values::array_get($payload, 'description'), + 'archived' => Values::array_get($payload, 'archived'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginConfigurationContext Context for this PluginConfigurationInstance + */ + protected function proxy(): PluginConfigurationContext + { + if (!$this->context) { + $this->context = new PluginConfigurationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PluginConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return PluginConfigurationInstance Fetched PluginConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginConfigurationInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Access the plugins + */ + protected function getPlugins(): ConfiguredPluginList + { + return $this->proxy()->plugins; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationList.php new file mode 100644 index 0000000..95deca8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationList.php @@ -0,0 +1,198 @@ +solution = [ + ]; + + $this->uri = '/PluginService/Configurations'; + } + + /** + * Create the PluginConfigurationInstance + * + * @param string $name The Flex Plugin Configuration's name. + * @param array|Options $options Optional Arguments + * @return PluginConfigurationInstance Created PluginConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $name, array $options = []): PluginConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + 'Plugins' => + Serialize::map($options['plugins'], function ($e) { return Serialize::jsonObject($e); }), + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PluginConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads PluginConfigurationInstance 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 PluginConfigurationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PluginConfigurationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PluginConfigurationInstance 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 PluginConfigurationPage Page of PluginConfigurationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PluginConfigurationPage + { + + $params = Values::of([ + 'Flex-Metadata' => + $options['flexMetadata'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PluginConfigurationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PluginConfigurationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PluginConfigurationPage Page of PluginConfigurationInstance + */ + public function getPage(string $targetUrl): PluginConfigurationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PluginConfigurationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PluginConfigurationContext + * + * @param string $sid The SID of the Flex Plugin Configuration resource to fetch. + */ + public function getContext( + string $sid + + ): PluginConfigurationContext + { + return new PluginConfigurationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationOptions.php new file mode 100644 index 0000000..c2cd25b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationOptions.php @@ -0,0 +1,216 @@ +options['plugins'] = $plugins; + $this->options['description'] = $description; + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * A list of objects that describe the plugin versions included in the configuration. Each object contains the sid of the plugin version. + * + * @param array[] $plugins A list of objects that describe the plugin versions included in the configuration. Each object contains the sid of the plugin version. + * @return $this Fluent Builder + */ + public function setPlugins(array $plugins): self + { + $this->options['plugins'] = $plugins; + return $this; + } + + /** + * The Flex Plugin Configuration's description. + * + * @param string $description The Flex Plugin Configuration's description. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreatePluginConfigurationOptions ' . $options . ']'; + } +} + +class FetchPluginConfigurationOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchPluginConfigurationOptions ' . $options . ']'; + } +} + +class ReadPluginConfigurationOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadPluginConfigurationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationPage.php new file mode 100644 index 0000000..a7920b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginConfigurationInstance \Twilio\Rest\FlexApi\V1\PluginConfigurationInstance + */ + public function buildInstance(array $payload): PluginConfigurationInstance + { + return new PluginConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginContext.php new file mode 100644 index 0000000..a90287e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginContext.php @@ -0,0 +1,175 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Plugins/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PluginInstance + * + * @param array|Options $options Optional Arguments + * @return PluginInstance Fetched PluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PluginInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the PluginInstance + * + * @param array|Options $options Optional Arguments + * @return PluginInstance Updated PluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new PluginInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the pluginVersions + */ + protected function getPluginVersions(): PluginVersionsList + { + if (!$this->_pluginVersions) { + $this->_pluginVersions = new PluginVersionsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_pluginVersions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginInstance.php new file mode 100644 index 0000000..42be07e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'archived' => Values::array_get($payload, 'archived'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginContext Context for this PluginInstance + */ + protected function proxy(): PluginContext + { + if (!$this->context) { + $this->context = new PluginContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PluginInstance + * + * @param array|Options $options Optional Arguments + * @return PluginInstance Fetched PluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the PluginInstance + * + * @param array|Options $options Optional Arguments + * @return PluginInstance Updated PluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the pluginVersions + */ + protected function getPluginVersions(): PluginVersionsList + { + return $this->proxy()->pluginVersions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginList.php new file mode 100644 index 0000000..9aa51e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/PluginService/Plugins'; + } + + /** + * Create the PluginInstance + * + * @param string $uniqueName The Flex Plugin's unique name. + * @param array|Options $options Optional Arguments + * @return PluginInstance Created PluginInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): PluginInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $options['friendlyName'], + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PluginInstance( + $this->version, + $payload + ); + } + + + /** + * Reads PluginInstance 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 PluginInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PluginInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PluginInstance 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 PluginPage Page of PluginInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PluginPage + { + + $params = Values::of([ + 'Flex-Metadata' => + $options['flexMetadata'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PluginPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PluginInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PluginPage Page of PluginInstance + */ + public function getPage(string $targetUrl): PluginPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PluginPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PluginContext + * + * @param string $sid The SID of the Flex Plugin resource to fetch. + */ + public function getContext( + string $sid + + ): PluginContext + { + return new PluginContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginOptions.php new file mode 100644 index 0000000..8f88677 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginOptions.php @@ -0,0 +1,304 @@ +options['friendlyName'] = $friendlyName; + $this->options['description'] = $description; + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex Plugin's friendly name. + * + * @param string $friendlyName The Flex Plugin's friendly name. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + * + * @param string $description A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreatePluginOptions ' . $options . ']'; + } +} + +class FetchPluginOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchPluginOptions ' . $options . ']'; + } +} + +class ReadPluginOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadPluginOptions ' . $options . ']'; + } +} + +class UpdatePluginOptions extends Options + { + /** + * @param string $friendlyName The Flex Plugin's friendly name. + * @param string $description A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $description = Values::NONE, + string $flexMetadata = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['description'] = $description; + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex Plugin's friendly name. + * + * @param string $friendlyName The Flex Plugin's friendly name. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + * + * @param string $description A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdatePluginOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginPage.php new file mode 100644 index 0000000..0f459f3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginInstance \Twilio\Rest\FlexApi\V1\PluginInstance + */ + public function buildInstance(array $payload): PluginInstance + { + return new PluginInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseContext.php new file mode 100644 index 0000000..5bfb259 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseContext.php @@ -0,0 +1,87 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Releases/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PluginReleaseInstance + * + * @param array|Options $options Optional Arguments + * @return PluginReleaseInstance Fetched PluginReleaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginReleaseInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PluginReleaseInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginReleaseContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseInstance.php new file mode 100644 index 0000000..af9e2e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseInstance.php @@ -0,0 +1,126 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'configurationSid' => Values::array_get($payload, 'configuration_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginReleaseContext Context for this PluginReleaseInstance + */ + protected function proxy(): PluginReleaseContext + { + if (!$this->context) { + $this->context = new PluginReleaseContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PluginReleaseInstance + * + * @param array|Options $options Optional Arguments + * @return PluginReleaseInstance Fetched PluginReleaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PluginReleaseInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginReleaseInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseList.php new file mode 100644 index 0000000..230a884 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseList.php @@ -0,0 +1,193 @@ +solution = [ + ]; + + $this->uri = '/PluginService/Releases'; + } + + /** + * Create the PluginReleaseInstance + * + * @param string $configurationId The SID or the Version of the Flex Plugin Configuration to release. + * @param array|Options $options Optional Arguments + * @return PluginReleaseInstance Created PluginReleaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $configurationId, array $options = []): PluginReleaseInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ConfigurationId' => + $configurationId, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PluginReleaseInstance( + $this->version, + $payload + ); + } + + + /** + * Reads PluginReleaseInstance 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 PluginReleaseInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PluginReleaseInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PluginReleaseInstance 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 PluginReleasePage Page of PluginReleaseInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PluginReleasePage + { + + $params = Values::of([ + 'Flex-Metadata' => + $options['flexMetadata'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PluginReleasePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PluginReleaseInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PluginReleasePage Page of PluginReleaseInstance + */ + public function getPage(string $targetUrl): PluginReleasePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PluginReleasePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PluginReleaseContext + * + * @param string $sid The SID of the Flex Plugin Release resource to fetch. + */ + public function getContext( + string $sid + + ): PluginReleaseContext + { + return new PluginReleaseContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginReleaseList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseOptions.php new file mode 100644 index 0000000..78bb67e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleaseOptions.php @@ -0,0 +1,180 @@ +options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreatePluginReleaseOptions ' . $options . ']'; + } +} + +class FetchPluginReleaseOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchPluginReleaseOptions ' . $options . ']'; + } +} + +class ReadPluginReleaseOptions extends Options + { + /** + * @param string $flexMetadata The Flex-Metadata HTTP request header + */ + public function __construct( + + string $flexMetadata = Values::NONE + + ) { + $this->options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadPluginReleaseOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleasePage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleasePage.php new file mode 100644 index 0000000..56fbae0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginReleasePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginReleaseInstance \Twilio\Rest\FlexApi\V1\PluginReleaseInstance + */ + public function buildInstance(array $payload): PluginReleaseInstance + { + return new PluginReleaseInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginReleasePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveContext.php new file mode 100644 index 0000000..d220053 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveContext.php @@ -0,0 +1,93 @@ +solution = [ + 'pluginSid' => + $pluginSid, + 'sid' => + $sid, + ]; + + $this->uri = '/PluginService/Plugins/' . \rawurlencode($pluginSid) + .'/Versions/' . \rawurlencode($sid) + .'/Archive'; + } + + /** + * Update the PluginVersionArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginVersionArchiveInstance Updated PluginVersionArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginVersionArchiveInstance + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Flex-Metadata' => $options['flexMetadata']]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new PluginVersionArchiveInstance( + $this->version, + $payload, + $this->solution['pluginSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginVersionArchiveContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveInstance.php new file mode 100644 index 0000000..96c3877 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'pluginSid' => Values::array_get($payload, 'plugin_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'version' => Values::array_get($payload, 'version'), + 'pluginUrl' => Values::array_get($payload, 'plugin_url'), + 'changelog' => Values::array_get($payload, 'changelog'), + 'private' => Values::array_get($payload, 'private'), + 'archived' => Values::array_get($payload, 'archived'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['pluginSid' => $pluginSid ?: $this->properties['pluginSid'], 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PluginVersionArchiveContext Context for this PluginVersionArchiveInstance + */ + protected function proxy(): PluginVersionArchiveContext + { + if (!$this->context) { + $this->context = new PluginVersionArchiveContext( + $this->version, + $this->solution['pluginSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the PluginVersionArchiveInstance + * + * @param array|Options $options Optional Arguments + * @return PluginVersionArchiveInstance Updated PluginVersionArchiveInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PluginVersionArchiveInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.PluginVersionArchiveInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveList.php new file mode 100644 index 0000000..e942861 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a PluginVersionArchiveContext + * + * @param string $pluginSid The SID of the Flex Plugin the resource to belongs to. + * + * @param string $sid The SID of the Flex Plugin Version resource to archive. + */ + public function getContext( + string $pluginSid + , string $sid + + ): PluginVersionArchiveContext + { + return new PluginVersionArchiveContext( + $this->version, + $pluginSid, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginVersionArchiveList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveOptions.php new file mode 100644 index 0000000..407baf4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchiveOptions.php @@ -0,0 +1,76 @@ +options['flexMetadata'] = $flexMetadata; + } + + /** + * The Flex-Metadata HTTP request header + * + * @param string $flexMetadata The Flex-Metadata HTTP request header + * @return $this Fluent Builder + */ + public function setFlexMetadata(string $flexMetadata): self + { + $this->options['flexMetadata'] = $flexMetadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdatePluginVersionArchiveOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchivePage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchivePage.php new file mode 100644 index 0000000..c51bd9b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/PluginVersionArchivePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PluginVersionArchiveInstance \Twilio\Rest\FlexApi\V1\PluginVersionArchiveInstance + */ + public function buildInstance(array $payload): PluginVersionArchiveInstance + { + return new PluginVersionArchiveInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.PluginVersionArchivePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php new file mode 100644 index 0000000..39d624d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/account/provision/status'; + } + + /** + * Fetch the ProvisioningStatusInstance + * + * @return ProvisioningStatusInstance Fetched ProvisioningStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ProvisioningStatusInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ProvisioningStatusInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ProvisioningStatusContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusInstance.php new file mode 100644 index 0000000..86b5793 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusInstance.php @@ -0,0 +1,115 @@ +properties = [ + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ProvisioningStatusContext Context for this ProvisioningStatusInstance + */ + protected function proxy(): ProvisioningStatusContext + { + if (!$this->context) { + $this->context = new ProvisioningStatusContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the ProvisioningStatusInstance + * + * @return ProvisioningStatusInstance Fetched ProvisioningStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ProvisioningStatusInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ProvisioningStatusInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusList.php new file mode 100644 index 0000000..f2aeedd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a ProvisioningStatusContext + */ + public function getContext( + + ): ProvisioningStatusContext + { + return new ProvisioningStatusContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ProvisioningStatusList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusPage.php new file mode 100644 index 0000000..8723d53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ProvisioningStatusInstance \Twilio\Rest\FlexApi\V1\ProvisioningStatusInstance + */ + public function buildInstance(array $payload): ProvisioningStatusInstance + { + return new ProvisioningStatusInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ProvisioningStatusPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php new file mode 100644 index 0000000..e860bd1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php @@ -0,0 +1,128 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/WebChannels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebChannelInstance + * + * @return WebChannelInstance Fetched WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the WebChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Updated WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ChatStatus' => + $options['chatStatus'], + 'PostEngagementData' => + $options['postEngagementData'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.WebChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelInstance.php new file mode 100644 index 0000000..28394d6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebChannelContext Context for this WebChannelInstance + */ + protected function proxy(): WebChannelContext + { + if (!$this->context) { + $this->context = new WebChannelContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebChannelInstance + * + * @return WebChannelInstance Fetched WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Updated WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.WebChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelList.php new file mode 100644 index 0000000..c829f69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/WebChannels'; + } + + /** + * Create the WebChannelInstance + * + * @param string $flexFlowSid The SID of the Flex Flow. + * @param string $identity The chat identity. + * @param string $customerFriendlyName The chat participant's friendly name. + * @param string $chatFriendlyName The chat channel's friendly name. + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Created WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $flexFlowSid, string $identity, string $customerFriendlyName, string $chatFriendlyName, array $options = []): WebChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FlexFlowSid' => + $flexFlowSid, + 'Identity' => + $identity, + 'CustomerFriendlyName' => + $customerFriendlyName, + 'ChatFriendlyName' => + $chatFriendlyName, + 'ChatUniqueName' => + $options['chatUniqueName'], + 'PreEngagementData' => + $options['preEngagementData'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebChannelInstance( + $this->version, + $payload + ); + } + + + /** + * Reads WebChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebChannelPage Page of WebChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebChannelPage Page of WebChannelInstance + */ + public function getPage(string $targetUrl): WebChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebChannelContext + * + * @param string $sid The SID of the WebChannel resource to delete. + */ + public function getContext( + string $sid + + ): WebChannelContext + { + return new WebChannelContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.WebChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelOptions.php new file mode 100644 index 0000000..29b4d6b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelOptions.php @@ -0,0 +1,168 @@ +options['chatUniqueName'] = $chatUniqueName; + $this->options['preEngagementData'] = $preEngagementData; + } + + /** + * The chat channel's unique name. + * + * @param string $chatUniqueName The chat channel's unique name. + * @return $this Fluent Builder + */ + public function setChatUniqueName(string $chatUniqueName): self + { + $this->options['chatUniqueName'] = $chatUniqueName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateWebChannelOptions ' . $options . ']'; + } +} + + + + +class UpdateWebChannelOptions extends Options + { + /** + * @param string $chatStatus + * @param string $postEngagementData The post-engagement data. + */ + public function __construct( + + string $chatStatus = Values::NONE, + string $postEngagementData = Values::NONE + + ) { + $this->options['chatStatus'] = $chatStatus; + $this->options['postEngagementData'] = $postEngagementData; + } + + /** + * @param string $chatStatus + * @return $this Fluent Builder + */ + public function setChatStatus(string $chatStatus): self + { + $this->options['chatStatus'] = $chatStatus; + return $this; + } + + /** + * The post-engagement data. + * + * @param string $postEngagementData The post-engagement data. + * @return $this Fluent Builder + */ + public function setPostEngagementData(string $postEngagementData): self + { + $this->options['postEngagementData'] = $postEngagementData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateWebChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelPage.php new file mode 100644 index 0000000..7327016 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V1/WebChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebChannelInstance \Twilio\Rest\FlexApi\V1\WebChannelInstance + */ + public function buildInstance(array $payload): WebChannelInstance + { + return new WebChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.WebChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2.php new file mode 100644 index 0000000..c1312f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2.php @@ -0,0 +1,106 @@ +version = 'v2'; + } + + protected function getFlexUser(): FlexUserList + { + if (!$this->_flexUser) { + $this->_flexUser = new FlexUserList($this); + } + return $this->_flexUser; + } + + protected function getWebChannels(): WebChannelsList + { + if (!$this->_webChannels) { + $this->_webChannels = new WebChannelsList($this); + } + return $this->_webChannels; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.FlexApi.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserContext.php new file mode 100644 index 0000000..ce0a930 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserContext.php @@ -0,0 +1,89 @@ +solution = [ + 'instanceSid' => + $instanceSid, + 'flexUserSid' => + $flexUserSid, + ]; + + $this->uri = '/Instances/' . \rawurlencode($instanceSid) + .'/Users/' . \rawurlencode($flexUserSid) + .''; + } + + /** + * Fetch the FlexUserInstance + * + * @return FlexUserInstance Fetched FlexUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexUserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlexUserInstance( + $this->version, + $payload, + $this->solution['instanceSid'], + $this->solution['flexUserSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V2.FlexUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserInstance.php new file mode 100644 index 0000000..21601be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserInstance.php @@ -0,0 +1,148 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'instanceSid' => Values::array_get($payload, 'instance_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'flexUserSid' => Values::array_get($payload, 'flex_user_sid'), + 'workerSid' => Values::array_get($payload, 'worker_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'flexTeamSid' => Values::array_get($payload, 'flex_team_sid'), + 'firstName' => Values::array_get($payload, 'first_name'), + 'lastName' => Values::array_get($payload, 'last_name'), + 'username' => Values::array_get($payload, 'username'), + 'email' => Values::array_get($payload, 'email'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'createdDate' => Deserialize::dateTime(Values::array_get($payload, 'created_date')), + 'updatedDate' => Deserialize::dateTime(Values::array_get($payload, 'updated_date')), + 'version' => Values::array_get($payload, 'version'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['instanceSid' => $instanceSid ?: $this->properties['instanceSid'], 'flexUserSid' => $flexUserSid ?: $this->properties['flexUserSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlexUserContext Context for this FlexUserInstance + */ + protected function proxy(): FlexUserContext + { + if (!$this->context) { + $this->context = new FlexUserContext( + $this->version, + $this->solution['instanceSid'], + $this->solution['flexUserSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FlexUserInstance + * + * @return FlexUserInstance Fetched FlexUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexUserInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V2.FlexUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserList.php new file mode 100644 index 0000000..9b1f329 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a FlexUserContext + * + * @param string $instanceSid The unique ID created by Twilio to identify a Flex instance. + * + * @param string $flexUserSid The unique id for the flex user to be retrieved. + */ + public function getContext( + string $instanceSid + , string $flexUserSid + + ): FlexUserContext + { + return new FlexUserContext( + $this->version, + $instanceSid, + $flexUserSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.FlexUserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserPage.php new file mode 100644 index 0000000..4062d57 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/FlexUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlexUserInstance \Twilio\Rest\FlexApi\V2\FlexUserInstance + */ + public function buildInstance(array $payload): FlexUserInstance + { + return new FlexUserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.FlexUserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php new file mode 100644 index 0000000..dd34daa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'identity' => Values::array_get($payload, 'identity'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsList.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsList.php new file mode 100644 index 0000000..f6f8717 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsList.php @@ -0,0 +1,88 @@ +solution = [ + ]; + + $this->uri = '/WebChats'; + } + + /** + * Create the WebChannelsInstance + * + * @param string $addressSid The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. + * @param array|Options $options Optional Arguments + * @return WebChannelsInstance Created WebChannelsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $addressSid, array $options = []): WebChannelsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AddressSid' => + $addressSid, + 'ChatFriendlyName' => + $options['chatFriendlyName'], + 'CustomerFriendlyName' => + $options['customerFriendlyName'], + 'PreEngagementData' => + $options['preEngagementData'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'Ui-Version' => $options['uiVersion']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebChannelsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php new file mode 100644 index 0000000..43f6f85 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php @@ -0,0 +1,131 @@ +options['chatFriendlyName'] = $chatFriendlyName; + $this->options['customerFriendlyName'] = $customerFriendlyName; + $this->options['preEngagementData'] = $preEngagementData; + $this->options['uiVersion'] = $uiVersion; + } + + /** + * The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. + * + * @param string $chatFriendlyName The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. + * @return $this Fluent Builder + */ + public function setChatFriendlyName(string $chatFriendlyName): self + { + $this->options['chatFriendlyName'] = $chatFriendlyName; + return $this; + } + + /** + * The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. + * + * @param string $customerFriendlyName The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. + * @return $this Fluent Builder + */ + public function setCustomerFriendlyName(string $customerFriendlyName): self + { + $this->options['customerFriendlyName'] = $customerFriendlyName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * The Ui-Version HTTP request header + * + * @param string $uiVersion The Ui-Version HTTP request header + * @return $this Fluent Builder + */ + public function setUiVersion(string $uiVersion): self + { + $this->options['uiVersion'] = $uiVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V2.CreateWebChannelsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsPage.php new file mode 100644 index 0000000..4fb157e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebChannelsInstance \Twilio\Rest\FlexApi\V2\WebChannelsInstance + */ + public function buildInstance(array $payload): WebChannelsInstance + { + return new WebChannelsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FlexApiBase.php b/vendor/twilio/sdk/src/Twilio/Rest/FlexApiBase.php new file mode 100644 index 0000000..1b6dc54 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FlexApiBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://flex-api.twilio.com'; + } + + + /** + * @return V1 Version v1 of flex-api + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of flex-api + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.FlexApi]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi.php new file mode 100644 index 0000000..179e99f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi.php @@ -0,0 +1,25 @@ +users instead. + */ + protected function getUsers(): \Twilio\Rest\FrontlineApi\V1\UserList { + echo "users is deprecated. Use v1->users instead."; + return $this->v1->users; + } + + /** + * @deprecated Use v1->users(\$sid) instead. + * @param string $sid The SID of the User resource to fetch + */ + protected function contextUsers(string $sid): \Twilio\Rest\FrontlineApi\V1\UserContext { + echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; + return $this->v1->users($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1.php new file mode 100644 index 0000000..76b6ac1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList($this); + } + return $this->_users; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.FrontlineApi.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserContext.php new file mode 100644 index 0000000..92cf68e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserContext.php @@ -0,0 +1,119 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Avatar' => + $options['avatar'], + 'State' => + $options['state'], + 'IsAvailable' => + Serialize::booleanToString($options['isAvailable']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FrontlineApi.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserInstance.php new file mode 100644 index 0000000..6343fbc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'avatar' => Values::array_get($payload, 'avatar'), + 'state' => Values::array_get($payload, 'state'), + 'isAvailable' => Values::array_get($payload, 'is_available'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FrontlineApi.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserList.php new file mode 100644 index 0000000..62726e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FrontlineApi.V1.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserOptions.php new file mode 100644 index 0000000..f690afd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserOptions.php @@ -0,0 +1,130 @@ +options['friendlyName'] = $friendlyName; + $this->options['avatar'] = $avatar; + $this->options['state'] = $state; + $this->options['isAvailable'] = $isAvailable; + } + + /** + * The string that you assigned to describe the User. + * + * @param string $friendlyName The string that you assigned to describe the User. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The avatar URL which will be shown in Frontline application. + * + * @param string $avatar The avatar URL which will be shown in Frontline application. + * @return $this Fluent Builder + */ + public function setAvatar(string $avatar): self + { + $this->options['avatar'] = $avatar; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). + * + * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). + * @return $this Fluent Builder + */ + public function setIsAvailable(bool $isAvailable): self + { + $this->options['isAvailable'] = $isAvailable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FrontlineApi.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserPage.php new file mode 100644 index 0000000..c439a78 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApi/V1/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\FrontlineApi\V1\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FrontlineApi.V1.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApiBase.php b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApiBase.php new file mode 100644 index 0000000..592f6dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/FrontlineApiBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://frontline-api.twilio.com'; + } + + + /** + * @return V1 Version v1 of frontline-api + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.FrontlineApi]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights.php new file mode 100644 index 0000000..63230de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights.php @@ -0,0 +1,83 @@ +settings instead. + */ + protected function getSettings(): \Twilio\Rest\Insights\V1\SettingList { + echo "settings is deprecated. Use v1->settings instead."; + return $this->v1->settings; + } + + /** + * @deprecated Use v1->settings() instead. + */ + protected function contextSettings(): \Twilio\Rest\Insights\V1\SettingContext { + echo "settings() is deprecated. Use v1->settings() instead."; + return $this->v1->settings(); + } + + /** + * @deprecated Use v1->calls instead. + */ + protected function getCalls(): \Twilio\Rest\Insights\V1\CallList { + echo "calls is deprecated. Use v1->calls instead."; + return $this->v1->calls; + } + + /** + * @deprecated Use v1->calls(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCalls(string $sid): \Twilio\Rest\Insights\V1\CallContext { + echo "calls(\$sid) is deprecated. Use v1->calls(\$sid) instead."; + return $this->v1->calls($sid); + } + + /** + * @deprecated Use v1->callSummaries instead. + */ + protected function getCallSummaries(): \Twilio\Rest\Insights\V1\CallSummariesList { + echo "callSummaries is deprecated. Use v1->callSummaries instead."; + return $this->v1->callSummaries; + } + + /** + * @deprecated Use v1->conferences instead. + */ + protected function getConferences(): \Twilio\Rest\Insights\V1\ConferenceList { + echo "conferences is deprecated. Use v1->conferences instead."; + return $this->v1->conferences; + } + + /** + * @deprecated Use v1->conferences(\$conferenceSid) instead. + * @param string $conferenceSid Conference SID. + */ + protected function contextConferences(string $conferenceSid): \Twilio\Rest\Insights\V1\ConferenceContext { + echo "conferences(\$conferenceSid) is deprecated. Use v1->conferences(\$conferenceSid) instead."; + return $this->v1->conferences($conferenceSid); + } + + /** + * @deprecated Use v1->rooms instead. + */ + protected function getRooms(): \Twilio\Rest\Insights\V1\RoomList { + echo "rooms is deprecated. Use v1->rooms instead."; + return $this->v1->rooms; + } + + /** + * @deprecated Use v1->rooms(\$roomSid) instead. + * @param string $roomSid The SID of the Room resource. + */ + protected function contextRooms(string $roomSid): \Twilio\Rest\Insights\V1\RoomContext { + echo "rooms(\$roomSid) is deprecated. Use v1->rooms(\$roomSid) instead."; + return $this->v1->rooms($roomSid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1.php new file mode 100644 index 0000000..cf3f543 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1.php @@ -0,0 +1,141 @@ +version = 'v1'; + } + + protected function getCalls(): CallList + { + if (!$this->_calls) { + $this->_calls = new CallList($this); + } + return $this->_calls; + } + + protected function getCallSummaries(): CallSummariesList + { + if (!$this->_callSummaries) { + $this->_callSummaries = new CallSummariesList($this); + } + return $this->_callSummaries; + } + + protected function getConferences(): ConferenceList + { + if (!$this->_conferences) { + $this->_conferences = new ConferenceList($this); + } + return $this->_conferences; + } + + protected function getRooms(): RoomList + { + if (!$this->_rooms) { + $this->_rooms = new RoomList($this); + } + return $this->_rooms; + } + + protected function getSettings(): SettingList + { + if (!$this->_settings) { + $this->_settings = new SettingList($this); + } + return $this->_settings; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Insights.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php new file mode 100644 index 0000000..34d291d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php @@ -0,0 +1,125 @@ +solution = [ + 'callSid' => + $callSid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Annotation'; + } + + /** + * Fetch the AnnotationInstance + * + * @return AnnotationInstance Fetched AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AnnotationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AnnotationInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Update the AnnotationInstance + * + * @param array|Options $options Optional Arguments + * @return AnnotationInstance Updated AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AnnotationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AnsweredBy' => + $options['answeredBy'], + 'ConnectivityIssue' => + $options['connectivityIssue'], + 'QualityIssues' => + $options['qualityIssues'], + 'Spam' => + Serialize::booleanToString($options['spam']), + 'CallScore' => + $options['callScore'], + 'Comment' => + $options['comment'], + 'Incident' => + $options['incident'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AnnotationInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.AnnotationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php new file mode 100644 index 0000000..aa774fd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'connectivityIssue' => Values::array_get($payload, 'connectivity_issue'), + 'qualityIssues' => Values::array_get($payload, 'quality_issues'), + 'spam' => Values::array_get($payload, 'spam'), + 'callScore' => Values::array_get($payload, 'call_score'), + 'comment' => Values::array_get($payload, 'comment'), + 'incident' => Values::array_get($payload, 'incident'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 AnnotationContext Context for this AnnotationInstance + */ + protected function proxy(): AnnotationContext + { + if (!$this->context) { + $this->context = new AnnotationContext( + $this->version, + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AnnotationInstance + * + * @return AnnotationInstance Fetched AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AnnotationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AnnotationInstance + * + * @param array|Options $options Optional Arguments + * @return AnnotationInstance Updated AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AnnotationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.AnnotationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationList.php new file mode 100644 index 0000000..3831a56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationList.php @@ -0,0 +1,67 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + } + + /** + * Constructs a AnnotationContext + */ + public function getContext( + + ): AnnotationContext + { + return new AnnotationContext( + $this->version, + $this->solution['callSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.AnnotationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php new file mode 100644 index 0000000..0b76f0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php @@ -0,0 +1,182 @@ +options['answeredBy'] = $answeredBy; + $this->options['connectivityIssue'] = $connectivityIssue; + $this->options['qualityIssues'] = $qualityIssues; + $this->options['spam'] = $spam; + $this->options['callScore'] = $callScore; + $this->options['comment'] = $comment; + $this->options['incident'] = $incident; + } + + /** + * @param string $answeredBy + * @return $this Fluent Builder + */ + public function setAnsweredBy(string $answeredBy): self + { + $this->options['answeredBy'] = $answeredBy; + return $this; + } + + /** + * @param string $connectivityIssue + * @return $this Fluent Builder + */ + public function setConnectivityIssue(string $connectivityIssue): self + { + $this->options['connectivityIssue'] = $connectivityIssue; + return $this; + } + + /** + * Specify if the call had any subjective quality issues. Possible values, one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. Use comma separated values to indicate multiple quality issues for the same call. + * + * @param string $qualityIssues Specify if the call had any subjective quality issues. Possible values, one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. Use comma separated values to indicate multiple quality issues for the same call. + * @return $this Fluent Builder + */ + public function setQualityIssues(string $qualityIssues): self + { + $this->options['qualityIssues'] = $qualityIssues; + return $this; + } + + /** + * A boolean flag to indicate if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Use `true` if the call was a spam call. + * + * @param bool $spam A boolean flag to indicate if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Use `true` if the call was a spam call. + * @return $this Fluent Builder + */ + public function setSpam(bool $spam): self + { + $this->options['spam'] = $spam; + return $this; + } + + /** + * Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * + * @param int $callScore Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * @return $this Fluent Builder + */ + public function setCallScore(int $callScore): self + { + $this->options['callScore'] = $callScore; + return $this; + } + + /** + * Specify any comments pertaining to the call. `comment` has a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in the `comment`. + * + * @param string $comment Specify any comments pertaining to the call. `comment` has a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in the `comment`. + * @return $this Fluent Builder + */ + public function setComment(string $comment): self + { + $this->options['comment'] = $comment; + return $this; + } + + /** + * Associate this call with an incident or support ticket. The `incident` parameter is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. + * + * @param string $incident Associate this call with an incident or support ticket. The `incident` parameter is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. + * @return $this Fluent Builder + */ + public function setIncident(string $incident): self + { + $this->options['incident'] = $incident; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.UpdateAnnotationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationPage.php new file mode 100644 index 0000000..795d9ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AnnotationInstance \Twilio\Rest\Insights\V1\Call\AnnotationInstance + */ + public function buildInstance(array $payload): AnnotationInstance + { + return new AnnotationInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.AnnotationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php new file mode 100644 index 0000000..ebe8558 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php @@ -0,0 +1,92 @@ +solution = [ + 'callSid' => + $callSid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Summary'; + } + + /** + * Fetch the CallSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return CallSummaryInstance Fetched CallSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): CallSummaryInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'ProcessingState' => + $options['processingState'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new CallSummaryInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallSummaryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php new file mode 100644 index 0000000..3c04549 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'callType' => Values::array_get($payload, 'call_type'), + 'callState' => Values::array_get($payload, 'call_state'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'createdTime' => Deserialize::dateTime(Values::array_get($payload, 'created_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'connectDuration' => Values::array_get($payload, 'connect_duration'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'tags' => Values::array_get($payload, 'tags'), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'properties' => Values::array_get($payload, 'properties'), + 'trust' => Values::array_get($payload, 'trust'), + 'annotation' => Values::array_get($payload, 'annotation'), + ]; + + $this->solution = ['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 CallSummaryContext Context for this CallSummaryInstance + */ + protected function proxy(): CallSummaryContext + { + if (!$this->context) { + $this->context = new CallSummaryContext( + $this->version, + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CallSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return CallSummaryInstance Fetched CallSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): CallSummaryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallSummaryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryList.php new file mode 100644 index 0000000..e8c2531 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryList.php @@ -0,0 +1,67 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + } + + /** + * Constructs a CallSummaryContext + */ + public function getContext( + + ): CallSummaryContext + { + return new CallSummaryContext( + $this->version, + $this->solution['callSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummaryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php new file mode 100644 index 0000000..466ca9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php @@ -0,0 +1,76 @@ +options['processingState'] = $processingState; + } + + /** + * The Processing State of this Call Summary. One of `complete`, `partial` or `all`. + * + * @param string $processingState The Processing State of this Call Summary. One of `complete`, `partial` or `all`. + * @return $this Fluent Builder + */ + public function setProcessingState(string $processingState): self + { + $this->options['processingState'] = $processingState; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchCallSummaryOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php new file mode 100644 index 0000000..e5c7b5a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallSummaryInstance \Twilio\Rest\Insights\V1\Call\CallSummaryInstance + */ + public function buildInstance(array $payload): CallSummaryInstance + { + return new CallSummaryInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummaryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventInstance.php new file mode 100644 index 0000000..09c80b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'edge' => Values::array_get($payload, 'edge'), + 'group' => Values::array_get($payload, 'group'), + 'level' => Values::array_get($payload, 'level'), + 'name' => Values::array_get($payload, 'name'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventList.php new file mode 100644 index 0000000..1f8b829 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventList.php @@ -0,0 +1,158 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Events'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance 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 EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'Edge' => + $options['edge'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventOptions.php new file mode 100644 index 0000000..d3f7798 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventOptions.php @@ -0,0 +1,76 @@ +options['edge'] = $edge; + } + + /** + * The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. + * + * @param string $edge The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. + * @return $this Fluent Builder + */ + public function setEdge(string $edge): self + { + $this->options['edge'] = $edge; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventPage.php new file mode 100644 index 0000000..c6a4be3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Insights\V1\Call\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricInstance.php new file mode 100644 index 0000000..e621e42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'edge' => Values::array_get($payload, 'edge'), + 'direction' => Values::array_get($payload, 'direction'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricList.php new file mode 100644 index 0000000..f918e7c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricList.php @@ -0,0 +1,160 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Metrics'; + } + + /** + * Reads MetricInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MetricInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MetricInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MetricInstance 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 MetricPage Page of MetricInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MetricPage + { + $options = new Values($options); + + $params = Values::of([ + 'Edge' => + $options['edge'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MetricPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MetricInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MetricPage Page of MetricInstance + */ + public function getPage(string $targetUrl): MetricPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MetricPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricOptions.php new file mode 100644 index 0000000..c2a2358 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricOptions.php @@ -0,0 +1,94 @@ +options['edge'] = $edge; + $this->options['direction'] = $direction; + } + + /** + * The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. + * + * @param string $edge The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. + * @return $this Fluent Builder + */ + public function setEdge(string $edge): self + { + $this->options['edge'] = $edge; + return $this; + } + + /** + * The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. + * + * @param string $direction The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadMetricOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricPage.php new file mode 100644 index 0000000..4477ce3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Call/MetricPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MetricInstance \Twilio\Rest\Insights\V1\Call\MetricInstance + */ + public function buildInstance(array $payload): MetricInstance + { + return new MetricInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallContext.php new file mode 100644 index 0000000..c8df7f0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallContext.php @@ -0,0 +1,196 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CallInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the metrics + */ + protected function getMetrics(): MetricList + { + if (!$this->_metrics) { + $this->_metrics = new MetricList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_metrics; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the summary + */ + protected function getSummary(): CallSummaryList + { + if (!$this->_summary) { + $this->_summary = new CallSummaryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_summary; + } + + /** + * Access the annotation + */ + protected function getAnnotation(): AnnotationList + { + if (!$this->_annotation) { + $this->_annotation = new AnnotationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_annotation; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallInstance.php new file mode 100644 index 0000000..0698617 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CallContext Context for this CallInstance + */ + protected function proxy(): CallContext + { + if (!$this->context) { + $this->context = new CallContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the metrics + */ + protected function getMetrics(): MetricList + { + return $this->proxy()->metrics; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the summary + */ + protected function getSummary(): CallSummaryList + { + return $this->proxy()->summary; + } + + /** + * Access the annotation + */ + protected function getAnnotation(): AnnotationList + { + return $this->proxy()->annotation; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallList.php new file mode 100644 index 0000000..02b0a42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a CallContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CallContext + { + return new CallContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallPage.php new file mode 100644 index 0000000..d351eb3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallInstance \Twilio\Rest\Insights\V1\CallInstance + */ + public function buildInstance(array $payload): CallInstance + { + return new CallInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesInstance.php new file mode 100644 index 0000000..5969e42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'callType' => Values::array_get($payload, 'call_type'), + 'callState' => Values::array_get($payload, 'call_state'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'createdTime' => Deserialize::dateTime(Values::array_get($payload, 'created_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'connectDuration' => Values::array_get($payload, 'connect_duration'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'tags' => Values::array_get($payload, 'tags'), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'properties' => Values::array_get($payload, 'properties'), + 'trust' => Values::array_get($payload, 'trust'), + 'annotation' => Values::array_get($payload, 'annotation'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesList.php new file mode 100644 index 0000000..7990adc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesList.php @@ -0,0 +1,199 @@ +solution = [ + ]; + + $this->uri = '/Voice/Summaries'; + } + + /** + * Reads CallSummariesInstance 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 CallSummariesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CallSummariesInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CallSummariesInstance 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 CallSummariesPage Page of CallSummariesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CallSummariesPage + { + $options = new Values($options); + + $params = Values::of([ + 'From' => + $options['from'], + 'To' => + $options['to'], + 'FromCarrier' => + $options['fromCarrier'], + 'ToCarrier' => + $options['toCarrier'], + 'FromCountryCode' => + $options['fromCountryCode'], + 'ToCountryCode' => + $options['toCountryCode'], + 'Branded' => + Serialize::booleanToString($options['branded']), + 'VerifiedCaller' => + Serialize::booleanToString($options['verifiedCaller']), + 'HasTag' => + Serialize::booleanToString($options['hasTag']), + 'StartTime' => + $options['startTime'], + 'EndTime' => + $options['endTime'], + 'CallType' => + $options['callType'], + 'CallState' => + $options['callState'], + 'Direction' => + $options['direction'], + 'ProcessingState' => + $options['processingState'], + 'SortBy' => + $options['sortBy'], + 'Subaccount' => + $options['subaccount'], + 'AbnormalSession' => + Serialize::booleanToString($options['abnormalSession']), + 'AnsweredBy' => + $options['answeredBy'], + 'AnsweredByAnnotation' => + $options['answeredByAnnotation'], + 'ConnectivityIssueAnnotation' => + $options['connectivityIssueAnnotation'], + 'QualityIssueAnnotation' => + $options['qualityIssueAnnotation'], + 'SpamAnnotation' => + Serialize::booleanToString($options['spamAnnotation']), + 'CallScoreAnnotation' => + $options['callScoreAnnotation'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CallSummariesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CallSummariesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CallSummariesPage Page of CallSummariesInstance + */ + public function getPage(string $targetUrl): CallSummariesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CallSummariesPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesOptions.php new file mode 100644 index 0000000..3186e71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesOptions.php @@ -0,0 +1,490 @@ +options['from'] = $from; + $this->options['to'] = $to; + $this->options['fromCarrier'] = $fromCarrier; + $this->options['toCarrier'] = $toCarrier; + $this->options['fromCountryCode'] = $fromCountryCode; + $this->options['toCountryCode'] = $toCountryCode; + $this->options['branded'] = $branded; + $this->options['verifiedCaller'] = $verifiedCaller; + $this->options['hasTag'] = $hasTag; + $this->options['startTime'] = $startTime; + $this->options['endTime'] = $endTime; + $this->options['callType'] = $callType; + $this->options['callState'] = $callState; + $this->options['direction'] = $direction; + $this->options['processingState'] = $processingState; + $this->options['sortBy'] = $sortBy; + $this->options['subaccount'] = $subaccount; + $this->options['abnormalSession'] = $abnormalSession; + $this->options['answeredBy'] = $answeredBy; + $this->options['answeredByAnnotation'] = $answeredByAnnotation; + $this->options['connectivityIssueAnnotation'] = $connectivityIssueAnnotation; + $this->options['qualityIssueAnnotation'] = $qualityIssueAnnotation; + $this->options['spamAnnotation'] = $spamAnnotation; + $this->options['callScoreAnnotation'] = $callScoreAnnotation; + } + + /** + * A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. + * + * @param string $from A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. + * + * @param string $to A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * An origination carrier. + * + * @param string $fromCarrier An origination carrier. + * @return $this Fluent Builder + */ + public function setFromCarrier(string $fromCarrier): self + { + $this->options['fromCarrier'] = $fromCarrier; + return $this; + } + + /** + * A destination carrier. + * + * @param string $toCarrier A destination carrier. + * @return $this Fluent Builder + */ + public function setToCarrier(string $toCarrier): self + { + $this->options['toCarrier'] = $toCarrier; + return $this; + } + + /** + * A source country code based on phone number in From. + * + * @param string $fromCountryCode A source country code based on phone number in From. + * @return $this Fluent Builder + */ + public function setFromCountryCode(string $fromCountryCode): self + { + $this->options['fromCountryCode'] = $fromCountryCode; + return $this; + } + + /** + * A destination country code. Based on phone number in To. + * + * @param string $toCountryCode A destination country code. Based on phone number in To. + * @return $this Fluent Builder + */ + public function setToCountryCode(string $toCountryCode): self + { + $this->options['toCountryCode'] = $toCountryCode; + return $this; + } + + /** + * A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. + * + * @param bool $branded A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. + * @return $this Fluent Builder + */ + public function setBranded(bool $branded): self + { + $this->options['branded'] = $branded; + return $this; + } + + /** + * A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + * + * @param bool $verifiedCaller A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + * @return $this Fluent Builder + */ + public function setVerifiedCaller(bool $verifiedCaller): self + { + $this->options['verifiedCaller'] = $verifiedCaller; + return $this; + } + + /** + * A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). + * + * @param bool $hasTag A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). + * @return $this Fluent Builder + */ + public function setHasTag(bool $hasTag): self + { + $this->options['hasTag'] = $hasTag; + return $this; + } + + /** + * A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. + * + * @param string $startTime A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. + * @return $this Fluent Builder + */ + public function setStartTime(string $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. + * + * @param string $endTime An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. + * @return $this Fluent Builder + */ + public function setEndTime(string $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. + * + * @param string $callType A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. + * @return $this Fluent Builder + */ + public function setCallType(string $callType): self + { + $this->options['callType'] = $callType; + return $this; + } + + /** + * A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. + * + * @param string $callState A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. + * @return $this Fluent Builder + */ + public function setCallState(string $callState): self + { + $this->options['callState'] = $callState; + return $this; + } + + /** + * A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. + * + * @param string $direction A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. + * + * @param string $processingState A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. + * @return $this Fluent Builder + */ + public function setProcessingState(string $processingState): self + { + $this->options['processingState'] = $processingState; + return $this; + } + + /** + * A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. + * + * @param string $sortBy A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. + * @return $this Fluent Builder + */ + public function setSortBy(string $sortBy): self + { + $this->options['sortBy'] = $sortBy; + return $this; + } + + /** + * A unique SID identifier of a Subaccount. + * + * @param string $subaccount A unique SID identifier of a Subaccount. + * @return $this Fluent Builder + */ + public function setSubaccount(string $subaccount): self + { + $this->options['subaccount'] = $subaccount; + return $this; + } + + /** + * A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. + * + * @param bool $abnormalSession A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. + * @return $this Fluent Builder + */ + public function setAbnormalSession(bool $abnormalSession): self + { + $this->options['abnormalSession'] = $abnormalSession; + return $this; + } + + /** + * An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. + * + * @param string $answeredBy An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. + * @return $this Fluent Builder + */ + public function setAnsweredBy(string $answeredBy): self + { + $this->options['answeredBy'] = $answeredBy; + return $this; + } + + /** + * Either machine or human. + * + * @param string $answeredByAnnotation Either machine or human. + * @return $this Fluent Builder + */ + public function setAnsweredByAnnotation(string $answeredByAnnotation): self + { + $this->options['answeredByAnnotation'] = $answeredByAnnotation; + return $this; + } + + /** + * A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. + * + * @param string $connectivityIssueAnnotation A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. + * @return $this Fluent Builder + */ + public function setConnectivityIssueAnnotation(string $connectivityIssueAnnotation): self + { + $this->options['connectivityIssueAnnotation'] = $connectivityIssueAnnotation; + return $this; + } + + /** + * A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. + * + * @param string $qualityIssueAnnotation A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. + * @return $this Fluent Builder + */ + public function setQualityIssueAnnotation(string $qualityIssueAnnotation): self + { + $this->options['qualityIssueAnnotation'] = $qualityIssueAnnotation; + return $this; + } + + /** + * A boolean flag indicating spam calls. + * + * @param bool $spamAnnotation A boolean flag indicating spam calls. + * @return $this Fluent Builder + */ + public function setSpamAnnotation(bool $spamAnnotation): self + { + $this->options['spamAnnotation'] = $spamAnnotation; + return $this; + } + + /** + * A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * + * @param string $callScoreAnnotation A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * @return $this Fluent Builder + */ + public function setCallScoreAnnotation(string $callScoreAnnotation): self + { + $this->options['callScoreAnnotation'] = $callScoreAnnotation; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadCallSummariesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesPage.php new file mode 100644 index 0000000..e9fb352 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/CallSummariesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallSummariesInstance \Twilio\Rest\Insights\V1\CallSummariesInstance + */ + public function buildInstance(array $payload): CallSummariesInstance + { + return new CallSummariesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php new file mode 100644 index 0000000..b6e706e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php @@ -0,0 +1,100 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + 'participantSid' => + $participantSid, + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants/' . \rawurlencode($participantSid) + .''; + } + + /** + * Fetch the ConferenceParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceParticipantInstance Fetched ConferenceParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConferenceParticipantInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Events' => + $options['events'], + 'Metrics' => + $options['metrics'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new ConferenceParticipantInstance( + $this->version, + $payload, + $this->solution['conferenceSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php new file mode 100644 index 0000000..ff210ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php @@ -0,0 +1,172 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'label' => Values::array_get($payload, 'label'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callDirection' => Values::array_get($payload, 'call_direction'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'callStatus' => Values::array_get($payload, 'call_status'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'isModerator' => Values::array_get($payload, 'is_moderator'), + 'joinTime' => Deserialize::dateTime(Values::array_get($payload, 'join_time')), + 'leaveTime' => Deserialize::dateTime(Values::array_get($payload, 'leave_time')), + 'durationSeconds' => Values::array_get($payload, 'duration_seconds'), + 'outboundQueueLength' => Values::array_get($payload, 'outbound_queue_length'), + 'outboundTimeInQueue' => Values::array_get($payload, 'outbound_time_in_queue'), + 'jitterBufferSize' => Values::array_get($payload, 'jitter_buffer_size'), + 'isCoach' => Values::array_get($payload, 'is_coach'), + 'coachedParticipants' => Values::array_get($payload, 'coached_participants'), + 'participantRegion' => Values::array_get($payload, 'participant_region'), + 'conferenceRegion' => Values::array_get($payload, 'conference_region'), + 'callType' => Values::array_get($payload, 'call_type'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'properties' => Values::array_get($payload, 'properties'), + 'events' => Values::array_get($payload, 'events'), + 'metrics' => Values::array_get($payload, 'metrics'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['conferenceSid' => $conferenceSid, 'participantSid' => $participantSid ?: $this->properties['participantSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConferenceParticipantContext Context for this ConferenceParticipantInstance + */ + protected function proxy(): ConferenceParticipantContext + { + if (!$this->context) { + $this->context = new ConferenceParticipantContext( + $this->version, + $this->solution['conferenceSid'], + $this->solution['participantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceParticipantInstance Fetched ConferenceParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConferenceParticipantInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php new file mode 100644 index 0000000..1c11d19 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php @@ -0,0 +1,179 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants'; + } + + /** + * Reads ConferenceParticipantInstance 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 ConferenceParticipantInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConferenceParticipantInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceParticipantInstance 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 ConferenceParticipantPage Page of ConferenceParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferenceParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + 'ParticipantSid' => + $options['participantSid'], + 'Label' => + $options['label'], + 'Events' => + $options['events'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConferenceParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConferenceParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConferenceParticipantPage Page of ConferenceParticipantInstance + */ + public function getPage(string $targetUrl): ConferenceParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferenceParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceParticipantContext + * + * @param string $participantSid The unique SID identifier of the Participant. + */ + public function getContext( + string $participantSid + + ): ConferenceParticipantContext + { + return new ConferenceParticipantContext( + $this->version, + $this->solution['conferenceSid'], + $participantSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php new file mode 100644 index 0000000..ddbc877 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php @@ -0,0 +1,182 @@ +options['events'] = $events; + $this->options['metrics'] = $metrics; + } + + /** + * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * @return $this Fluent Builder + */ + public function setEvents(string $events): self + { + $this->options['events'] = $events; + return $this; + } + + /** + * Object. Contains participant call quality metrics. + * + * @param string $metrics Object. Contains participant call quality metrics. + * @return $this Fluent Builder + */ + public function setMetrics(string $metrics): self + { + $this->options['metrics'] = $metrics; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchConferenceParticipantOptions ' . $options . ']'; + } +} + +class ReadConferenceParticipantOptions extends Options + { + /** + * @param string $participantSid The unique SID identifier of the Participant. + * @param string $label User-specified label for a participant. + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + */ + public function __construct( + + string $participantSid = Values::NONE, + string $label = Values::NONE, + string $events = Values::NONE + + ) { + $this->options['participantSid'] = $participantSid; + $this->options['label'] = $label; + $this->options['events'] = $events; + } + + /** + * The unique SID identifier of the Participant. + * + * @param string $participantSid The unique SID identifier of the Participant. + * @return $this Fluent Builder + */ + public function setParticipantSid(string $participantSid): self + { + $this->options['participantSid'] = $participantSid; + return $this; + } + + /** + * User-specified label for a participant. + * + * @param string $label User-specified label for a participant. + * @return $this Fluent Builder + */ + public function setLabel(string $label): self + { + $this->options['label'] = $label; + return $this; + } + + /** + * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * @return $this Fluent Builder + */ + public function setEvents(string $events): self + { + $this->options['events'] = $events; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadConferenceParticipantOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php new file mode 100644 index 0000000..98da65b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceParticipantInstance \Twilio\Rest\Insights\V1\Conference\ConferenceParticipantInstance + */ + public function buildInstance(array $payload): ConferenceParticipantInstance + { + return new ConferenceParticipantInstance($this->version, $payload, $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceContext.php new file mode 100644 index 0000000..bc6375d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceContext.php @@ -0,0 +1,141 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .''; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['conferenceSid'] + ); + } + + + /** + * Access the conferenceParticipants + */ + protected function getConferenceParticipants(): ConferenceParticipantList + { + if (!$this->_conferenceParticipants) { + $this->_conferenceParticipants = new ConferenceParticipantList( + $this->version, + $this->solution['conferenceSid'] + ); + } + + return $this->_conferenceParticipants; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceInstance.php new file mode 100644 index 0000000..d471c96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'createTime' => Deserialize::dateTime(Values::array_get($payload, 'create_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'durationSeconds' => Values::array_get($payload, 'duration_seconds'), + 'connectDurationSeconds' => Values::array_get($payload, 'connect_duration_seconds'), + 'status' => Values::array_get($payload, 'status'), + 'maxParticipants' => Values::array_get($payload, 'max_participants'), + 'maxConcurrentParticipants' => Values::array_get($payload, 'max_concurrent_participants'), + 'uniqueParticipants' => Values::array_get($payload, 'unique_participants'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'endedBy' => Values::array_get($payload, 'ended_by'), + 'mixerRegion' => Values::array_get($payload, 'mixer_region'), + 'mixerRegionRequested' => Values::array_get($payload, 'mixer_region_requested'), + 'recordingEnabled' => Values::array_get($payload, 'recording_enabled'), + 'detectedIssues' => Values::array_get($payload, 'detected_issues'), + 'tags' => Values::array_get($payload, 'tags'), + 'tagInfo' => Values::array_get($payload, 'tag_info'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['conferenceSid' => $conferenceSid ?: $this->properties['conferenceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConferenceContext Context for this ConferenceInstance + */ + protected function proxy(): ConferenceContext + { + if (!$this->context) { + $this->context = new ConferenceContext( + $this->version, + $this->solution['conferenceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the conferenceParticipants + */ + protected function getConferenceParticipants(): ConferenceParticipantList + { + return $this->proxy()->conferenceParticipants; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceList.php new file mode 100644 index 0000000..eeab6ce --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Conferences'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceInstance 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 ConferencePage Page of ConferenceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferencePage + { + $options = new Values($options); + + $params = Values::of([ + 'ConferenceSid' => + $options['conferenceSid'], + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + 'CreatedAfter' => + $options['createdAfter'], + 'CreatedBefore' => + $options['createdBefore'], + 'MixerRegion' => + $options['mixerRegion'], + 'Tags' => + $options['tags'], + 'Subaccount' => + $options['subaccount'], + 'DetectedIssues' => + $options['detectedIssues'], + 'EndReason' => + $options['endReason'], + '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 ConferencePage Page of ConferenceInstance + */ + public function getPage(string $targetUrl): ConferencePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferencePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceContext + * + * @param string $conferenceSid The unique SID identifier of the Conference. + */ + public function getContext( + string $conferenceSid + + ): ConferenceContext + { + return new ConferenceContext( + $this->version, + $conferenceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceOptions.php new file mode 100644 index 0000000..220df35 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferenceOptions.php @@ -0,0 +1,240 @@ +options['conferenceSid'] = $conferenceSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + $this->options['createdAfter'] = $createdAfter; + $this->options['createdBefore'] = $createdBefore; + $this->options['mixerRegion'] = $mixerRegion; + $this->options['tags'] = $tags; + $this->options['subaccount'] = $subaccount; + $this->options['detectedIssues'] = $detectedIssues; + $this->options['endReason'] = $endReason; + } + + /** + * The SID of the conference. + * + * @param string $conferenceSid The SID of the conference. + * @return $this Fluent Builder + */ + public function setConferenceSid(string $conferenceSid): self + { + $this->options['conferenceSid'] = $conferenceSid; + return $this; + } + + /** + * Custom label for the conference resource, up to 64 characters. + * + * @param string $friendlyName Custom label for the conference resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Conference status. + * + * @param string $status Conference status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Conferences created after the provided timestamp specified in ISO 8601 format + * + * @param string $createdAfter Conferences created after the provided timestamp specified in ISO 8601 format + * @return $this Fluent Builder + */ + public function setCreatedAfter(string $createdAfter): self + { + $this->options['createdAfter'] = $createdAfter; + return $this; + } + + /** + * Conferences created before the provided timestamp specified in ISO 8601 format. + * + * @param string $createdBefore Conferences created before the provided timestamp specified in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setCreatedBefore(string $createdBefore): self + { + $this->options['createdBefore'] = $createdBefore; + return $this; + } + + /** + * Twilio region where the conference media was mixed. + * + * @param string $mixerRegion Twilio region where the conference media was mixed. + * @return $this Fluent Builder + */ + public function setMixerRegion(string $mixerRegion): self + { + $this->options['mixerRegion'] = $mixerRegion; + return $this; + } + + /** + * Tags applied by Twilio for common potential configuration, quality, or performance issues. + * + * @param string $tags Tags applied by Twilio for common potential configuration, quality, or performance issues. + * @return $this Fluent Builder + */ + public function setTags(string $tags): self + { + $this->options['tags'] = $tags; + return $this; + } + + /** + * Account SID for the subaccount whose resources you wish to retrieve. + * + * @param string $subaccount Account SID for the subaccount whose resources you wish to retrieve. + * @return $this Fluent Builder + */ + public function setSubaccount(string $subaccount): self + { + $this->options['subaccount'] = $subaccount; + return $this; + } + + /** + * Potential configuration, behavior, or performance issues detected during the conference. + * + * @param string $detectedIssues Potential configuration, behavior, or performance issues detected during the conference. + * @return $this Fluent Builder + */ + public function setDetectedIssues(string $detectedIssues): self + { + $this->options['detectedIssues'] = $detectedIssues; + return $this; + } + + /** + * Conference end reason; e.g. last participant left, modified by API, etc. + * + * @param string $endReason Conference end reason; e.g. last participant left, modified by API, etc. + * @return $this Fluent Builder + */ + public function setEndReason(string $endReason): self + { + $this->options['endReason'] = $endReason; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadConferenceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferencePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferencePage.php new file mode 100644 index 0000000..147cef9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/ConferencePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceInstance \Twilio\Rest\Insights\V1\ConferenceInstance + */ + public function buildInstance(array $payload): ConferenceInstance + { + return new ConferenceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferencePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php new file mode 100644 index 0000000..0e0e9c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php @@ -0,0 +1,89 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .''; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php new file mode 100644 index 0000000..ef03a42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'joinTime' => Deserialize::dateTime(Values::array_get($payload, 'join_time')), + 'leaveTime' => Deserialize::dateTime(Values::array_get($payload, 'leave_time')), + 'durationSec' => Values::array_get($payload, 'duration_sec'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'status' => Values::array_get($payload, 'status'), + 'codecs' => Values::array_get($payload, 'codecs'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorCodeUrl' => Values::array_get($payload, 'error_code_url'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'properties' => Values::array_get($payload, 'properties'), + 'edgeLocation' => Values::array_get($payload, 'edge_location'), + 'publisherInfo' => Values::array_get($payload, 'publisher_info'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid ?: $this->properties['participantSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantList.php new file mode 100644 index 0000000..d7f377d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantList.php @@ -0,0 +1,168 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .'/Participants'; + } + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + '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 ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $participantSid The SID of the Participant resource. + */ + public function getContext( + string $participantSid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $participantSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantPage.php new file mode 100644 index 0000000..034bc1e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Insights\V1\Room\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomContext.php new file mode 100644 index 0000000..8bccf0e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomContext.php @@ -0,0 +1,141 @@ +solution = [ + 'roomSid' => + $roomSid, + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .''; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['roomSid'] + ); + } + + return $this->_participants; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.RoomContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomInstance.php new file mode 100644 index 0000000..91a5fe6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomInstance.php @@ -0,0 +1,177 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'roomName' => Values::array_get($payload, 'room_name'), + 'createTime' => Deserialize::dateTime(Values::array_get($payload, 'create_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'roomType' => Values::array_get($payload, 'room_type'), + 'roomStatus' => Values::array_get($payload, 'room_status'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'createdMethod' => Values::array_get($payload, 'created_method'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'maxParticipants' => Values::array_get($payload, 'max_participants'), + 'uniqueParticipants' => Values::array_get($payload, 'unique_participants'), + 'uniqueParticipantIdentities' => Values::array_get($payload, 'unique_participant_identities'), + 'concurrentParticipants' => Values::array_get($payload, 'concurrent_participants'), + 'maxConcurrentParticipants' => Values::array_get($payload, 'max_concurrent_participants'), + 'codecs' => Values::array_get($payload, 'codecs'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'durationSec' => Values::array_get($payload, 'duration_sec'), + 'totalParticipantDurationSec' => Values::array_get($payload, 'total_participant_duration_sec'), + 'totalRecordingDurationSec' => Values::array_get($payload, 'total_recording_duration_sec'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'recordingEnabled' => Values::array_get($payload, 'recording_enabled'), + 'edgeLocation' => Values::array_get($payload, 'edge_location'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['roomSid' => $roomSid ?: $this->properties['roomSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoomContext Context for this RoomInstance + */ + protected function proxy(): RoomContext + { + if (!$this->context) { + $this->context = new RoomContext( + $this->version, + $this->solution['roomSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.RoomInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomList.php new file mode 100644 index 0000000..537ebb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomList.php @@ -0,0 +1,177 @@ +solution = [ + ]; + + $this->uri = '/Video/Rooms'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomInstance 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 RoomPage Page of RoomInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomPage + { + $options = new Values($options); + + $params = Values::of([ + 'RoomType' => + $options['roomType'], + 'Codec' => + $options['codec'], + 'RoomName' => + $options['roomName'], + 'CreatedAfter' => + Serialize::iso8601DateTime($options['createdAfter']), + 'CreatedBefore' => + Serialize::iso8601DateTime($options['createdBefore']), + '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 RoomPage Page of RoomInstance + */ + public function getPage(string $targetUrl): RoomPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomContext + * + * @param string $roomSid The SID of the Room resource. + */ + public function getContext( + string $roomSid + + ): RoomContext + { + return new RoomContext( + $this->version, + $roomSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.RoomList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomOptions.php new file mode 100644 index 0000000..ebef804 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomOptions.php @@ -0,0 +1,150 @@ +options['roomType'] = $roomType; + $this->options['codec'] = $codec; + $this->options['roomName'] = $roomName; + $this->options['createdAfter'] = $createdAfter; + $this->options['createdBefore'] = $createdBefore; + } + + /** + * Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. + * + * @param string $roomType Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. + * @return $this Fluent Builder + */ + public function setRoomType(array $roomType): self + { + $this->options['roomType'] = $roomType; + return $this; + } + + /** + * Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. + * + * @param string $codec Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. + * @return $this Fluent Builder + */ + public function setCodec(array $codec): self + { + $this->options['codec'] = $codec; + return $this; + } + + /** + * Room friendly name. + * + * @param string $roomName Room friendly name. + * @return $this Fluent Builder + */ + public function setRoomName(string $roomName): self + { + $this->options['roomName'] = $roomName; + return $this; + } + + /** + * Only read rooms that started on or after this ISO 8601 timestamp. + * + * @param \DateTime $createdAfter Only read rooms that started on or after this ISO 8601 timestamp. + * @return $this Fluent Builder + */ + public function setCreatedAfter(\DateTime $createdAfter): self + { + $this->options['createdAfter'] = $createdAfter; + return $this; + } + + /** + * Only read rooms that started before this ISO 8601 timestamp. + * + * @param \DateTime $createdBefore Only read rooms that started before this ISO 8601 timestamp. + * @return $this Fluent Builder + */ + public function setCreatedBefore(\DateTime $createdBefore): self + { + $this->options['createdBefore'] = $createdBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadRoomOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomPage.php new file mode 100644 index 0000000..2e358fb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/RoomPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomInstance \Twilio\Rest\Insights\V1\RoomInstance + */ + public function buildInstance(array $payload): RoomInstance + { + return new RoomInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.RoomPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingContext.php new file mode 100644 index 0000000..649c530 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingContext.php @@ -0,0 +1,118 @@ +solution = [ + ]; + + $this->uri = '/Voice/Settings'; + } + + /** + * Fetch the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Fetched SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): SettingInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'SubaccountSid' => + $options['subaccountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new SettingInstance( + $this->version, + $payload + ); + } + + + /** + * Update the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Updated SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AdvancedFeatures' => + Serialize::booleanToString($options['advancedFeatures']), + 'VoiceTrace' => + Serialize::booleanToString($options['voiceTrace']), + 'SubaccountSid' => + $options['subaccountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SettingInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.SettingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingInstance.php new file mode 100644 index 0000000..4e00721 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'advancedFeatures' => Values::array_get($payload, 'advanced_features'), + 'voiceTrace' => Values::array_get($payload, 'voice_trace'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SettingContext Context for this SettingInstance + */ + protected function proxy(): SettingContext + { + if (!$this->context) { + $this->context = new SettingContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Fetched SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): SettingInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Updated SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.SettingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingList.php new file mode 100644 index 0000000..79a61dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SettingContext + */ + public function getContext( + + ): SettingContext + { + return new SettingContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.SettingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingOptions.php new file mode 100644 index 0000000..cc80fb7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingOptions.php @@ -0,0 +1,164 @@ +options['subaccountSid'] = $subaccountSid; + } + + /** + * The unique SID identifier of the Subaccount. + * + * @param string $subaccountSid The unique SID identifier of the Subaccount. + * @return $this Fluent Builder + */ + public function setSubaccountSid(string $subaccountSid): self + { + $this->options['subaccountSid'] = $subaccountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchSettingOptions ' . $options . ']'; + } +} + +class UpdateSettingOptions extends Options + { + /** + * @param bool $advancedFeatures A boolean flag to enable Advanced Features for Voice Insights. + * @param bool $voiceTrace A boolean flag to enable Voice Trace. + * @param string $subaccountSid The unique SID identifier of the Subaccount. + */ + public function __construct( + + bool $advancedFeatures = Values::BOOL_NONE, + bool $voiceTrace = Values::BOOL_NONE, + string $subaccountSid = Values::NONE + + ) { + $this->options['advancedFeatures'] = $advancedFeatures; + $this->options['voiceTrace'] = $voiceTrace; + $this->options['subaccountSid'] = $subaccountSid; + } + + /** + * A boolean flag to enable Advanced Features for Voice Insights. + * + * @param bool $advancedFeatures A boolean flag to enable Advanced Features for Voice Insights. + * @return $this Fluent Builder + */ + public function setAdvancedFeatures(bool $advancedFeatures): self + { + $this->options['advancedFeatures'] = $advancedFeatures; + return $this; + } + + /** + * A boolean flag to enable Voice Trace. + * + * @param bool $voiceTrace A boolean flag to enable Voice Trace. + * @return $this Fluent Builder + */ + public function setVoiceTrace(bool $voiceTrace): self + { + $this->options['voiceTrace'] = $voiceTrace; + return $this; + } + + /** + * The unique SID identifier of the Subaccount. + * + * @param string $subaccountSid The unique SID identifier of the Subaccount. + * @return $this Fluent Builder + */ + public function setSubaccountSid(string $subaccountSid): self + { + $this->options['subaccountSid'] = $subaccountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.UpdateSettingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingPage.php new file mode 100644 index 0000000..d1dffd8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Insights/V1/SettingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingInstance \Twilio\Rest\Insights\V1\SettingInstance + */ + public function buildInstance(array $payload): SettingInstance + { + return new SettingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.SettingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/InsightsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/InsightsBase.php new file mode 100644 index 0000000..5ab6d63 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/InsightsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://insights.twilio.com'; + } + + + /** + * @return V1 Version v1 of insights + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Insights]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence.php new file mode 100644 index 0000000..0f7c766 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence.php @@ -0,0 +1,5 @@ +version = 'v2'; + } + + protected function getCustomOperators(): CustomOperatorList + { + if (!$this->_customOperators) { + $this->_customOperators = new CustomOperatorList($this); + } + return $this->_customOperators; + } + + protected function getOperators(): OperatorList + { + if (!$this->_operators) { + $this->_operators = new OperatorList($this); + } + return $this->_operators; + } + + protected function getOperatorAttachment(): OperatorAttachmentList + { + if (!$this->_operatorAttachment) { + $this->_operatorAttachment = new OperatorAttachmentList($this); + } + return $this->_operatorAttachment; + } + + protected function getOperatorAttachments(): OperatorAttachmentsList + { + if (!$this->_operatorAttachments) { + $this->_operatorAttachments = new OperatorAttachmentsList($this); + } + return $this->_operatorAttachments; + } + + protected function getOperatorType(): OperatorTypeList + { + if (!$this->_operatorType) { + $this->_operatorType = new OperatorTypeList($this); + } + return $this->_operatorType; + } + + protected function getPrebuiltOperators(): PrebuiltOperatorList + { + if (!$this->_prebuiltOperators) { + $this->_prebuiltOperators = new PrebuiltOperatorList($this); + } + return $this->_prebuiltOperators; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getTranscripts(): TranscriptList + { + if (!$this->_transcripts) { + $this->_transcripts = new TranscriptList($this); + } + return $this->_transcripts; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Intelligence.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorContext.php new file mode 100644 index 0000000..1012376 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorContext.php @@ -0,0 +1,131 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Operators/Custom/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomOperatorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CustomOperatorInstance + * + * @return CustomOperatorInstance Fetched CustomOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomOperatorInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CustomOperatorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CustomOperatorInstance + * + * @param string $friendlyName A human-readable name of this resource, up to 64 characters. + * @param array $config Operator configuration, following the schema defined by the Operator Type. + * @param array|Options $options Optional Arguments + * @return CustomOperatorInstance Updated CustomOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $config, array $options = []): CustomOperatorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Config' => + Serialize::jsonObject($config), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CustomOperatorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.CustomOperatorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorInstance.php new file mode 100644 index 0000000..2b0c74c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'author' => Values::array_get($payload, 'author'), + 'operatorType' => Values::array_get($payload, 'operator_type'), + 'version' => Values::array_get($payload, 'version'), + 'availability' => Values::array_get($payload, 'availability'), + 'config' => Values::array_get($payload, 'config'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomOperatorContext Context for this CustomOperatorInstance + */ + protected function proxy(): CustomOperatorContext + { + if (!$this->context) { + $this->context = new CustomOperatorContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomOperatorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomOperatorInstance + * + * @return CustomOperatorInstance Fetched CustomOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomOperatorInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CustomOperatorInstance + * + * @param string $friendlyName A human-readable name of this resource, up to 64 characters. + * @param array $config Operator configuration, following the schema defined by the Operator Type. + * @param array|Options $options Optional Arguments + * @return CustomOperatorInstance Updated CustomOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $config, array $options = []): CustomOperatorInstance + { + + return $this->proxy()->update($friendlyName, $config, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.CustomOperatorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorList.php new file mode 100644 index 0000000..5f32ed5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Operators/Custom'; + } + + /** + * Create the CustomOperatorInstance + * + * @param string $friendlyName A human readable description of the new Operator, up to 64 characters. + * @param string $operatorType Operator Type for this Operator. References an existing Operator Type resource. + * @param array $config Operator configuration, following the schema defined by the Operator Type. + * @return CustomOperatorInstance Created CustomOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $operatorType, array $config): CustomOperatorInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'OperatorType' => + $operatorType, + 'Config' => + Serialize::jsonObject($config), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CustomOperatorInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CustomOperatorInstance 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 CustomOperatorInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomOperatorInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomOperatorInstance 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 CustomOperatorPage Page of CustomOperatorInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomOperatorPage + { + $options = new Values($options); + + $params = Values::of([ + 'Availability' => + $options['availability'], + 'LanguageCode' => + $options['languageCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomOperatorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomOperatorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomOperatorPage Page of CustomOperatorInstance + */ + public function getPage(string $targetUrl): CustomOperatorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomOperatorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomOperatorContext + * + * @param string $sid A 34 character string that uniquely identifies this Custom Operator. + */ + public function getContext( + string $sid + + ): CustomOperatorContext + { + return new CustomOperatorContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.CustomOperatorList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorOptions.php new file mode 100644 index 0000000..9e22a6b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorOptions.php @@ -0,0 +1,152 @@ +options['availability'] = $availability; + $this->options['languageCode'] = $languageCode; + } + + /** + * Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + * + * @param string $availability Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + * @return $this Fluent Builder + */ + public function setAvailability(string $availability): self + { + $this->options['availability'] = $availability; + return $this; + } + + /** + * Returns Custom Operators that support the provided language code. + * + * @param string $languageCode Returns Custom Operators that support the provided language code. + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadCustomOperatorOptions ' . $options . ']'; + } +} + +class UpdateCustomOperatorOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.UpdateCustomOperatorOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorPage.php new file mode 100644 index 0000000..e856e00 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/CustomOperatorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomOperatorInstance \Twilio\Rest\Intelligence\V2\CustomOperatorInstance + */ + public function buildInstance(array $payload): CustomOperatorInstance + { + return new CustomOperatorInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.CustomOperatorPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentContext.php new file mode 100644 index 0000000..e4f46aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'operatorSid' => + $operatorSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Operators/' . \rawurlencode($operatorSid) + .''; + } + + /** + * Create the OperatorAttachmentInstance + * + * @return OperatorAttachmentInstance Created OperatorAttachmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): OperatorAttachmentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new OperatorAttachmentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['operatorSid'] + ); + } + + + /** + * Delete the OperatorAttachmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorAttachmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentInstance.php new file mode 100644 index 0000000..72f2bd7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'operatorSid' => Values::array_get($payload, 'operator_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid ?: $this->properties['serviceSid'], 'operatorSid' => $operatorSid ?: $this->properties['operatorSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OperatorAttachmentContext Context for this OperatorAttachmentInstance + */ + protected function proxy(): OperatorAttachmentContext + { + if (!$this->context) { + $this->context = new OperatorAttachmentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['operatorSid'] + ); + } + + return $this->context; + } + + /** + * Create the OperatorAttachmentInstance + * + * @return OperatorAttachmentInstance Created OperatorAttachmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): OperatorAttachmentInstance + { + + return $this->proxy()->create(); + } + + /** + * Delete the OperatorAttachmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorAttachmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentList.php new file mode 100644 index 0000000..215eb2d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a OperatorAttachmentContext + * + * @param string $serviceSid The unique SID identifier of the Service. + * + * @param string $operatorSid The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. + */ + public function getContext( + string $serviceSid + , string $operatorSid + + ): OperatorAttachmentContext + { + return new OperatorAttachmentContext( + $this->version, + $serviceSid, + $operatorSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorAttachmentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentPage.php new file mode 100644 index 0000000..2f02635 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OperatorAttachmentInstance \Twilio\Rest\Intelligence\V2\OperatorAttachmentInstance + */ + public function buildInstance(array $payload): OperatorAttachmentInstance + { + return new OperatorAttachmentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorAttachmentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsContext.php new file mode 100644 index 0000000..f29bc19 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsContext.php @@ -0,0 +1,83 @@ +solution = [ + 'serviceSid' => + $serviceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Operators'; + } + + /** + * Fetch the OperatorAttachmentsInstance + * + * @return OperatorAttachmentsInstance Fetched OperatorAttachmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorAttachmentsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new OperatorAttachmentsInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorAttachmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsInstance.php new file mode 100644 index 0000000..8120aaa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsInstance.php @@ -0,0 +1,119 @@ +properties = [ + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'operatorSids' => Values::array_get($payload, 'operator_sids'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid ?: $this->properties['serviceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OperatorAttachmentsContext Context for this OperatorAttachmentsInstance + */ + protected function proxy(): OperatorAttachmentsContext + { + if (!$this->context) { + $this->context = new OperatorAttachmentsContext( + $this->version, + $this->solution['serviceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the OperatorAttachmentsInstance + * + * @return OperatorAttachmentsInstance Fetched OperatorAttachmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorAttachmentsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorAttachmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsList.php new file mode 100644 index 0000000..24671b2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a OperatorAttachmentsContext + * + * @param string $serviceSid The unique SID identifier of the Service. + */ + public function getContext( + string $serviceSid + + ): OperatorAttachmentsContext + { + return new OperatorAttachmentsContext( + $this->version, + $serviceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorAttachmentsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsPage.php new file mode 100644 index 0000000..7d03e1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorAttachmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OperatorAttachmentsInstance \Twilio\Rest\Intelligence\V2\OperatorAttachmentsInstance + */ + public function buildInstance(array $payload): OperatorAttachmentsInstance + { + return new OperatorAttachmentsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorAttachmentsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorContext.php new file mode 100644 index 0000000..6e4f69f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Operators/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the OperatorInstance + * + * @return OperatorInstance Fetched OperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new OperatorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorInstance.php new file mode 100644 index 0000000..a401d46 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'author' => Values::array_get($payload, 'author'), + 'operatorType' => Values::array_get($payload, 'operator_type'), + 'version' => Values::array_get($payload, 'version'), + 'availability' => Values::array_get($payload, 'availability'), + 'config' => Values::array_get($payload, 'config'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OperatorContext Context for this OperatorInstance + */ + protected function proxy(): OperatorContext + { + if (!$this->context) { + $this->context = new OperatorContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the OperatorInstance + * + * @return OperatorInstance Fetched OperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorList.php new file mode 100644 index 0000000..22c5131 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorList.php @@ -0,0 +1,170 @@ +solution = [ + ]; + + $this->uri = '/Operators'; + } + + /** + * Reads OperatorInstance 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 OperatorInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams OperatorInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OperatorInstance 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 OperatorPage Page of OperatorInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OperatorPage + { + $options = new Values($options); + + $params = Values::of([ + 'Availability' => + $options['availability'], + 'LanguageCode' => + $options['languageCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new OperatorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of OperatorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return OperatorPage Page of OperatorInstance + */ + public function getPage(string $targetUrl): OperatorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OperatorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OperatorContext + * + * @param string $sid A 34 character string that uniquely identifies this Operator. + */ + public function getContext( + string $sid + + ): OperatorContext + { + return new OperatorContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorOptions.php new file mode 100644 index 0000000..0525206 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorOptions.php @@ -0,0 +1,96 @@ +options['availability'] = $availability; + $this->options['languageCode'] = $languageCode; + } + + /** + * Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + * + * @param string $availability Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + * @return $this Fluent Builder + */ + public function setAvailability(string $availability): self + { + $this->options['availability'] = $availability; + return $this; + } + + /** + * Returns Operators that support the provided language code. + * + * @param string $languageCode Returns Operators that support the provided language code. + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadOperatorOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorPage.php new file mode 100644 index 0000000..6b066e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OperatorInstance \Twilio\Rest\Intelligence\V2\OperatorInstance + */ + public function buildInstance(array $payload): OperatorInstance + { + return new OperatorInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeContext.php new file mode 100644 index 0000000..33a7cf1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/OperatorTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the OperatorTypeInstance + * + * @return OperatorTypeInstance Fetched OperatorTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new OperatorTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeInstance.php new file mode 100644 index 0000000..c0bfcb7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'name' => Values::array_get($payload, 'name'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'docsLink' => Values::array_get($payload, 'docs_link'), + 'outputType' => Values::array_get($payload, 'output_type'), + 'supportedLanguages' => Values::array_get($payload, 'supported_languages'), + 'provider' => Values::array_get($payload, 'provider'), + 'availability' => Values::array_get($payload, 'availability'), + 'configurable' => Values::array_get($payload, 'configurable'), + 'configSchema' => Values::array_get($payload, 'config_schema'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OperatorTypeContext Context for this OperatorTypeInstance + */ + protected function proxy(): OperatorTypeContext + { + if (!$this->context) { + $this->context = new OperatorTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the OperatorTypeInstance + * + * @return OperatorTypeInstance Fetched OperatorTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OperatorTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeList.php new file mode 100644 index 0000000..4891004 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/OperatorTypes'; + } + + /** + * Reads OperatorTypeInstance 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 OperatorTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams OperatorTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OperatorTypeInstance 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 OperatorTypePage Page of OperatorTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OperatorTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new OperatorTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of OperatorTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return OperatorTypePage Page of OperatorTypeInstance + */ + public function getPage(string $targetUrl): OperatorTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OperatorTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OperatorTypeContext + * + * @param string $sid A 34 character string that uniquely identifies this Operator Type. + */ + public function getContext( + string $sid + + ): OperatorTypeContext + { + return new OperatorTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypePage.php new file mode 100644 index 0000000..ddf5811 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/OperatorTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OperatorTypeInstance \Twilio\Rest\Intelligence\V2\OperatorTypeInstance + */ + public function buildInstance(array $payload): OperatorTypeInstance + { + return new OperatorTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorContext.php new file mode 100644 index 0000000..bcda23e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Operators/PreBuilt/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PrebuiltOperatorInstance + * + * @return PrebuiltOperatorInstance Fetched PrebuiltOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PrebuiltOperatorInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PrebuiltOperatorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.PrebuiltOperatorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorInstance.php new file mode 100644 index 0000000..8e38258 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'author' => Values::array_get($payload, 'author'), + 'operatorType' => Values::array_get($payload, 'operator_type'), + 'version' => Values::array_get($payload, 'version'), + 'availability' => Values::array_get($payload, 'availability'), + 'config' => Values::array_get($payload, 'config'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PrebuiltOperatorContext Context for this PrebuiltOperatorInstance + */ + protected function proxy(): PrebuiltOperatorContext + { + if (!$this->context) { + $this->context = new PrebuiltOperatorContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PrebuiltOperatorInstance + * + * @return PrebuiltOperatorInstance Fetched PrebuiltOperatorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PrebuiltOperatorInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.PrebuiltOperatorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorList.php new file mode 100644 index 0000000..1963850 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorList.php @@ -0,0 +1,170 @@ +solution = [ + ]; + + $this->uri = '/Operators/PreBuilt'; + } + + /** + * Reads PrebuiltOperatorInstance 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 PrebuiltOperatorInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams PrebuiltOperatorInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PrebuiltOperatorInstance 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 PrebuiltOperatorPage Page of PrebuiltOperatorInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PrebuiltOperatorPage + { + $options = new Values($options); + + $params = Values::of([ + 'Availability' => + $options['availability'], + 'LanguageCode' => + $options['languageCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PrebuiltOperatorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PrebuiltOperatorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PrebuiltOperatorPage Page of PrebuiltOperatorInstance + */ + public function getPage(string $targetUrl): PrebuiltOperatorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PrebuiltOperatorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PrebuiltOperatorContext + * + * @param string $sid A 34 character string that uniquely identifies this Pre-built Operator. + */ + public function getContext( + string $sid + + ): PrebuiltOperatorContext + { + return new PrebuiltOperatorContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.PrebuiltOperatorList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorOptions.php new file mode 100644 index 0000000..420865f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorOptions.php @@ -0,0 +1,96 @@ +options['availability'] = $availability; + $this->options['languageCode'] = $languageCode; + } + + /** + * Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + * + * @param string $availability Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + * @return $this Fluent Builder + */ + public function setAvailability(string $availability): self + { + $this->options['availability'] = $availability; + return $this; + } + + /** + * Returns Pre-built Operators that support the provided language code. + * + * @param string $languageCode Returns Pre-built Operators that support the provided language code. + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadPrebuiltOperatorOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorPage.php new file mode 100644 index 0000000..7b736f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/PrebuiltOperatorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PrebuiltOperatorInstance \Twilio\Rest\Intelligence\V2\PrebuiltOperatorInstance + */ + public function buildInstance(array $payload): PrebuiltOperatorInstance + { + return new PrebuiltOperatorInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.PrebuiltOperatorPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceContext.php new file mode 100644 index 0000000..74a3ccd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceContext.php @@ -0,0 +1,141 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AutoTranscribe' => + Serialize::booleanToString($options['autoTranscribe']), + 'DataLogging' => + Serialize::booleanToString($options['dataLogging']), + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'AutoRedaction' => + Serialize::booleanToString($options['autoRedaction']), + 'MediaRedaction' => + Serialize::booleanToString($options['mediaRedaction']), + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookHttpMethod' => + $options['webhookHttpMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceInstance.php new file mode 100644 index 0000000..bb72142 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceInstance.php @@ -0,0 +1,172 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'autoRedaction' => Values::array_get($payload, 'auto_redaction'), + 'mediaRedaction' => Values::array_get($payload, 'media_redaction'), + 'autoTranscribe' => Values::array_get($payload, 'auto_transcribe'), + 'dataLogging' => Values::array_get($payload, 'data_logging'), + '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'), + 'languageCode' => Values::array_get($payload, 'language_code'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookHttpMethod' => Values::array_get($payload, 'webhook_http_method'), + 'readOnlyAttachedOperatorSids' => Values::array_get($payload, 'read_only_attached_operator_sids'), + 'version' => Values::array_get($payload, 'version'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceList.php new file mode 100644 index 0000000..bae055b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'AutoTranscribe' => + Serialize::booleanToString($options['autoTranscribe']), + 'DataLogging' => + Serialize::booleanToString($options['dataLogging']), + 'FriendlyName' => + $options['friendlyName'], + 'LanguageCode' => + $options['languageCode'], + 'AutoRedaction' => + Serialize::booleanToString($options['autoRedaction']), + 'MediaRedaction' => + Serialize::booleanToString($options['mediaRedaction']), + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookHttpMethod' => + $options['webhookHttpMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid A 34 character string that uniquely identifies this Service. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceOptions.php new file mode 100644 index 0000000..70c525f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServiceOptions.php @@ -0,0 +1,400 @@ +options['autoTranscribe'] = $autoTranscribe; + $this->options['dataLogging'] = $dataLogging; + $this->options['friendlyName'] = $friendlyName; + $this->options['languageCode'] = $languageCode; + $this->options['autoRedaction'] = $autoRedaction; + $this->options['mediaRedaction'] = $mediaRedaction; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['webhookHttpMethod'] = $webhookHttpMethod; + } + + /** + * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + * + * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + * @return $this Fluent Builder + */ + public function setAutoTranscribe(bool $autoTranscribe): self + { + $this->options['autoTranscribe'] = $autoTranscribe; + return $this; + } + + /** + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + * + * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + * @return $this Fluent Builder + */ + public function setDataLogging(bool $dataLogging): self + { + $this->options['dataLogging'] = $dataLogging; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set. + * + * @param string $languageCode The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set. + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + * + * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + * @return $this Fluent Builder + */ + public function setAutoRedaction(bool $autoRedaction): self + { + $this->options['autoRedaction'] = $autoRedaction; + return $this; + } + + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + * + * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + * @return $this Fluent Builder + */ + public function setMediaRedaction(bool $mediaRedaction): self + { + $this->options['mediaRedaction'] = $mediaRedaction; + return $this; + } + + /** + * The URL Twilio will request when executing the Webhook. + * + * @param string $webhookUrl The URL Twilio will request when executing the Webhook. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * @param string $webhookHttpMethod + * @return $this Fluent Builder + */ + public function setWebhookHttpMethod(string $webhookHttpMethod): self + { + $this->options['webhookHttpMethod'] = $webhookHttpMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. + * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + * @param string $webhookUrl The URL Twilio will request when executing the Webhook. + * @param string $webhookHttpMethod + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + bool $autoTranscribe = Values::BOOL_NONE, + bool $dataLogging = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + bool $autoRedaction = Values::BOOL_NONE, + bool $mediaRedaction = Values::BOOL_NONE, + string $webhookUrl = Values::NONE, + string $webhookHttpMethod = Values::NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['autoTranscribe'] = $autoTranscribe; + $this->options['dataLogging'] = $dataLogging; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['autoRedaction'] = $autoRedaction; + $this->options['mediaRedaction'] = $mediaRedaction; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['webhookHttpMethod'] = $webhookHttpMethod; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + * + * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. + * @return $this Fluent Builder + */ + public function setAutoTranscribe(bool $autoTranscribe): self + { + $this->options['autoTranscribe'] = $autoTranscribe; + return $this; + } + + /** + * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + * + * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. + * @return $this Fluent Builder + */ + public function setDataLogging(bool $dataLogging): self + { + $this->options['dataLogging'] = $dataLogging; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + * + * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. + * @return $this Fluent Builder + */ + public function setAutoRedaction(bool $autoRedaction): self + { + $this->options['autoRedaction'] = $autoRedaction; + return $this; + } + + /** + * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + * + * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. + * @return $this Fluent Builder + */ + public function setMediaRedaction(bool $mediaRedaction): self + { + $this->options['mediaRedaction'] = $mediaRedaction; + return $this; + } + + /** + * The URL Twilio will request when executing the Webhook. + * + * @param string $webhookUrl The URL Twilio will request when executing the Webhook. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * @param string $webhookHttpMethod + * @return $this Fluent Builder + */ + public function setWebhookHttpMethod(string $webhookHttpMethod): self + { + $this->options['webhookHttpMethod'] = $webhookHttpMethod; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServicePage.php new file mode 100644 index 0000000..54b2506 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Intelligence\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php new file mode 100644 index 0000000..9e99168 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php @@ -0,0 +1,93 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Transcripts/' . \rawurlencode($sid) + .'/Media'; + } + + /** + * Fetch the MediaInstance + * + * @param array|Options $options Optional Arguments + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): MediaInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Redacted' => + Serialize::booleanToString($options['redacted']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new MediaInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.MediaContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaInstance.php new file mode 100644 index 0000000..0ca57c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'mediaUrl' => Values::array_get($payload, 'media_url'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MediaContext Context for this MediaInstance + */ + protected function proxy(): MediaContext + { + if (!$this->context) { + $this->context = new MediaContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the MediaInstance + * + * @param array|Options $options Optional Arguments + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): MediaInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.MediaInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaList.php new file mode 100644 index 0000000..6ff3b11 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaList.php @@ -0,0 +1,67 @@ +solution = [ + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a MediaContext + */ + public function getContext( + + ): MediaContext + { + return new MediaContext( + $this->version, + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.MediaList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaOptions.php new file mode 100644 index 0000000..7bd7991 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaOptions.php @@ -0,0 +1,76 @@ +options['redacted'] = $redacted; + } + + /** + * Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. + * + * @param bool $redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. + * @return $this Fluent Builder + */ + public function setRedacted(bool $redacted): self + { + $this->options['redacted'] = $redacted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.FetchMediaOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaPage.php new file mode 100644 index 0000000..5346bd1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MediaInstance \Twilio\Rest\Intelligence\V2\Transcript\MediaInstance + */ + public function buildInstance(array $payload): MediaInstance + { + return new MediaInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.MediaPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php new file mode 100644 index 0000000..13be73e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php @@ -0,0 +1,99 @@ +solution = [ + 'transcriptSid' => + $transcriptSid, + 'operatorSid' => + $operatorSid, + ]; + + $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) + .'/OperatorResults/' . \rawurlencode($operatorSid) + .''; + } + + /** + * Fetch the OperatorResultInstance + * + * @param array|Options $options Optional Arguments + * @return OperatorResultInstance Fetched OperatorResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): OperatorResultInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Redacted' => + Serialize::booleanToString($options['redacted']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new OperatorResultInstance( + $this->version, + $payload, + $this->solution['transcriptSid'], + $this->solution['operatorSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorResultContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultInstance.php new file mode 100644 index 0000000..bdaa033 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'operatorType' => Values::array_get($payload, 'operator_type'), + 'name' => Values::array_get($payload, 'name'), + 'operatorSid' => Values::array_get($payload, 'operator_sid'), + 'extractMatch' => Values::array_get($payload, 'extract_match'), + 'matchProbability' => Values::array_get($payload, 'match_probability'), + 'normalizedResult' => Values::array_get($payload, 'normalized_result'), + 'utteranceResults' => Values::array_get($payload, 'utterance_results'), + 'utteranceMatch' => Values::array_get($payload, 'utterance_match'), + 'predictedLabel' => Values::array_get($payload, 'predicted_label'), + 'predictedProbability' => Values::array_get($payload, 'predicted_probability'), + 'labelProbabilities' => Values::array_get($payload, 'label_probabilities'), + 'extractResults' => Values::array_get($payload, 'extract_results'), + 'textGenerationResults' => Values::array_get($payload, 'text_generation_results'), + 'transcriptSid' => Values::array_get($payload, 'transcript_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['transcriptSid' => $transcriptSid, 'operatorSid' => $operatorSid ?: $this->properties['operatorSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OperatorResultContext Context for this OperatorResultInstance + */ + protected function proxy(): OperatorResultContext + { + if (!$this->context) { + $this->context = new OperatorResultContext( + $this->version, + $this->solution['transcriptSid'], + $this->solution['operatorSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the OperatorResultInstance + * + * @param array|Options $options Optional Arguments + * @return OperatorResultInstance Fetched OperatorResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): OperatorResultInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.OperatorResultInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultList.php new file mode 100644 index 0000000..c7f35bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultList.php @@ -0,0 +1,176 @@ +solution = [ + 'transcriptSid' => + $transcriptSid, + + ]; + + $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) + .'/OperatorResults'; + } + + /** + * Reads OperatorResultInstance 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 OperatorResultInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams OperatorResultInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OperatorResultInstance 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 OperatorResultPage Page of OperatorResultInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OperatorResultPage + { + $options = new Values($options); + + $params = Values::of([ + 'Redacted' => + Serialize::booleanToString($options['redacted']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new OperatorResultPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of OperatorResultInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return OperatorResultPage Page of OperatorResultInstance + */ + public function getPage(string $targetUrl): OperatorResultPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OperatorResultPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OperatorResultContext + * + * @param string $operatorSid A 34 character string that identifies this Language Understanding operator sid. + */ + public function getContext( + string $operatorSid + + ): OperatorResultContext + { + return new OperatorResultContext( + $this->version, + $this->solution['transcriptSid'], + $operatorSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorResultList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultOptions.php new file mode 100644 index 0000000..4f44e79 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultOptions.php @@ -0,0 +1,128 @@ +options['redacted'] = $redacted; + } + + /** + * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. + * + * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. + * @return $this Fluent Builder + */ + public function setRedacted(bool $redacted): self + { + $this->options['redacted'] = $redacted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.FetchOperatorResultOptions ' . $options . ']'; + } +} + +class ReadOperatorResultOptions extends Options + { + /** + * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. + */ + public function __construct( + + bool $redacted = Values::BOOL_NONE + + ) { + $this->options['redacted'] = $redacted; + } + + /** + * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. + * + * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. + * @return $this Fluent Builder + */ + public function setRedacted(bool $redacted): self + { + $this->options['redacted'] = $redacted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadOperatorResultOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultPage.php new file mode 100644 index 0000000..c79fe63 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OperatorResultInstance \Twilio\Rest\Intelligence\V2\Transcript\OperatorResultInstance + */ + public function buildInstance(array $payload): OperatorResultInstance + { + return new OperatorResultInstance($this->version, $payload, $this->solution['transcriptSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.OperatorResultPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceInstance.php new file mode 100644 index 0000000..d0bc993 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceInstance.php @@ -0,0 +1,93 @@ +properties = [ + 'mediaChannel' => Values::array_get($payload, 'media_channel'), + 'sentenceIndex' => Values::array_get($payload, 'sentence_index'), + 'startTime' => Values::array_get($payload, 'start_time'), + 'endTime' => Values::array_get($payload, 'end_time'), + 'transcript' => Values::array_get($payload, 'transcript'), + 'sid' => Values::array_get($payload, 'sid'), + 'confidence' => Values::array_get($payload, 'confidence'), + ]; + + $this->solution = ['transcriptSid' => $transcriptSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.SentenceInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceList.php new file mode 100644 index 0000000..24fec6f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceList.php @@ -0,0 +1,159 @@ +solution = [ + 'transcriptSid' => + $transcriptSid, + + ]; + + $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) + .'/Sentences'; + } + + /** + * Reads SentenceInstance 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 SentenceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SentenceInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SentenceInstance 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 SentencePage Page of SentenceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SentencePage + { + $options = new Values($options); + + $params = Values::of([ + 'Redacted' => + Serialize::booleanToString($options['redacted']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SentencePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SentenceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SentencePage Page of SentenceInstance + */ + public function getPage(string $targetUrl): SentencePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SentencePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.SentenceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceOptions.php new file mode 100644 index 0000000..fcf42ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceOptions.php @@ -0,0 +1,76 @@ +options['redacted'] = $redacted; + } + + /** + * Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + * + * @param bool $redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + * @return $this Fluent Builder + */ + public function setRedacted(bool $redacted): self + { + $this->options['redacted'] = $redacted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadSentenceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentencePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentencePage.php new file mode 100644 index 0000000..1e1c528 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentencePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SentenceInstance \Twilio\Rest\Intelligence\V2\Transcript\SentenceInstance + */ + public function buildInstance(array $payload): SentenceInstance + { + return new SentenceInstance($this->version, $payload, $this->solution['transcriptSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.SentencePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php new file mode 100644 index 0000000..71df19a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php @@ -0,0 +1,192 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Transcripts/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TranscriptInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TranscriptInstance + * + * @return TranscriptInstance Fetched TranscriptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TranscriptInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the sentences + */ + protected function getSentences(): SentenceList + { + if (!$this->_sentences) { + $this->_sentences = new SentenceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sentences; + } + + /** + * Access the operatorResults + */ + protected function getOperatorResults(): OperatorResultList + { + if (!$this->_operatorResults) { + $this->_operatorResults = new OperatorResultList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_operatorResults; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + if (!$this->_media) { + $this->_media = new MediaList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_media; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.TranscriptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptInstance.php new file mode 100644 index 0000000..b0e87ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptInstance.php @@ -0,0 +1,187 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'status' => Values::array_get($payload, 'status'), + 'channel' => Values::array_get($payload, 'channel'), + 'dataLogging' => Values::array_get($payload, 'data_logging'), + 'languageCode' => Values::array_get($payload, 'language_code'), + 'customerKey' => Values::array_get($payload, 'customer_key'), + 'mediaStartTime' => Deserialize::dateTime(Values::array_get($payload, 'media_start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'url' => Values::array_get($payload, 'url'), + 'redaction' => Values::array_get($payload, 'redaction'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TranscriptContext Context for this TranscriptInstance + */ + protected function proxy(): TranscriptContext + { + if (!$this->context) { + $this->context = new TranscriptContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TranscriptInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TranscriptInstance + * + * @return TranscriptInstance Fetched TranscriptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the sentences + */ + protected function getSentences(): SentenceList + { + return $this->proxy()->sentences; + } + + /** + * Access the operatorResults + */ + protected function getOperatorResults(): OperatorResultList + { + return $this->proxy()->operatorResults; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Intelligence.V2.TranscriptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptList.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptList.php new file mode 100644 index 0000000..930e557 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptList.php @@ -0,0 +1,219 @@ +solution = [ + ]; + + $this->uri = '/Transcripts'; + } + + /** + * Create the TranscriptInstance + * + * @param string $serviceSid The unique SID identifier of the Service. + * @param array $channel JSON object describing Media Channel including Source and Participants + * @param array|Options $options Optional Arguments + * @return TranscriptInstance Created TranscriptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $serviceSid, array $channel, array $options = []): TranscriptInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ServiceSid' => + $serviceSid, + 'Channel' => + Serialize::jsonObject($channel), + 'CustomerKey' => + $options['customerKey'], + 'MediaStartTime' => + Serialize::iso8601DateTime($options['mediaStartTime']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TranscriptInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TranscriptInstance 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 TranscriptInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TranscriptInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TranscriptInstance 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 TranscriptPage Page of TranscriptInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TranscriptPage + { + $options = new Values($options); + + $params = Values::of([ + 'ServiceSid' => + $options['serviceSid'], + 'BeforeStartTime' => + $options['beforeStartTime'], + 'AfterStartTime' => + $options['afterStartTime'], + 'BeforeDateCreated' => + $options['beforeDateCreated'], + 'AfterDateCreated' => + $options['afterDateCreated'], + 'Status' => + $options['status'], + 'LanguageCode' => + $options['languageCode'], + 'SourceSid' => + $options['sourceSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TranscriptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TranscriptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TranscriptPage Page of TranscriptInstance + */ + public function getPage(string $targetUrl): TranscriptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TranscriptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TranscriptContext + * + * @param string $sid A 34 character string that uniquely identifies this Transcript. + */ + public function getContext( + string $sid + + ): TranscriptContext + { + return new TranscriptContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.TranscriptList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptOptions.php new file mode 100644 index 0000000..4d04c07 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptOptions.php @@ -0,0 +1,276 @@ +options['customerKey'] = $customerKey; + $this->options['mediaStartTime'] = $mediaStartTime; + } + + /** + * Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. + * + * @param string $customerKey Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. + * @return $this Fluent Builder + */ + public function setCustomerKey(string $customerKey): self + { + $this->options['customerKey'] = $customerKey; + return $this; + } + + /** + * The date that this Transcript's media was started, given in ISO 8601 format. + * + * @param \DateTime $mediaStartTime The date that this Transcript's media was started, given in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setMediaStartTime(\DateTime $mediaStartTime): self + { + $this->options['mediaStartTime'] = $mediaStartTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.CreateTranscriptOptions ' . $options . ']'; + } +} + + + +class ReadTranscriptOptions extends Options + { + /** + * @param string $serviceSid The unique SID identifier of the Service. + * @param string $beforeStartTime Filter by before StartTime. + * @param string $afterStartTime Filter by after StartTime. + * @param string $beforeDateCreated Filter by before DateCreated. + * @param string $afterDateCreated Filter by after DateCreated. + * @param string $status Filter by status. + * @param string $languageCode Filter by Language Code. + * @param string $sourceSid Filter by SourceSid. + */ + public function __construct( + + string $serviceSid = Values::NONE, + string $beforeStartTime = Values::NONE, + string $afterStartTime = Values::NONE, + string $beforeDateCreated = Values::NONE, + string $afterDateCreated = Values::NONE, + string $status = Values::NONE, + string $languageCode = Values::NONE, + string $sourceSid = Values::NONE + + ) { + $this->options['serviceSid'] = $serviceSid; + $this->options['beforeStartTime'] = $beforeStartTime; + $this->options['afterStartTime'] = $afterStartTime; + $this->options['beforeDateCreated'] = $beforeDateCreated; + $this->options['afterDateCreated'] = $afterDateCreated; + $this->options['status'] = $status; + $this->options['languageCode'] = $languageCode; + $this->options['sourceSid'] = $sourceSid; + } + + /** + * The unique SID identifier of the Service. + * + * @param string $serviceSid The unique SID identifier of the Service. + * @return $this Fluent Builder + */ + public function setServiceSid(string $serviceSid): self + { + $this->options['serviceSid'] = $serviceSid; + return $this; + } + + /** + * Filter by before StartTime. + * + * @param string $beforeStartTime Filter by before StartTime. + * @return $this Fluent Builder + */ + public function setBeforeStartTime(string $beforeStartTime): self + { + $this->options['beforeStartTime'] = $beforeStartTime; + return $this; + } + + /** + * Filter by after StartTime. + * + * @param string $afterStartTime Filter by after StartTime. + * @return $this Fluent Builder + */ + public function setAfterStartTime(string $afterStartTime): self + { + $this->options['afterStartTime'] = $afterStartTime; + return $this; + } + + /** + * Filter by before DateCreated. + * + * @param string $beforeDateCreated Filter by before DateCreated. + * @return $this Fluent Builder + */ + public function setBeforeDateCreated(string $beforeDateCreated): self + { + $this->options['beforeDateCreated'] = $beforeDateCreated; + return $this; + } + + /** + * Filter by after DateCreated. + * + * @param string $afterDateCreated Filter by after DateCreated. + * @return $this Fluent Builder + */ + public function setAfterDateCreated(string $afterDateCreated): self + { + $this->options['afterDateCreated'] = $afterDateCreated; + return $this; + } + + /** + * Filter by status. + * + * @param string $status Filter by status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Filter by Language Code. + * + * @param string $languageCode Filter by Language Code. + * @return $this Fluent Builder + */ + public function setLanguageCode(string $languageCode): self + { + $this->options['languageCode'] = $languageCode; + return $this; + } + + /** + * Filter by SourceSid. + * + * @param string $sourceSid Filter by SourceSid. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Intelligence.V2.ReadTranscriptOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptPage.php new file mode 100644 index 0000000..c4e4682 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Intelligence/V2/TranscriptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptInstance \Twilio\Rest\Intelligence\V2\TranscriptInstance + */ + public function buildInstance(array $payload): TranscriptInstance + { + return new TranscriptInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Intelligence.V2.TranscriptPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IntelligenceBase.php b/vendor/twilio/sdk/src/Twilio/Rest/IntelligenceBase.php new file mode 100644 index 0000000..ad48615 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IntelligenceBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://intelligence.twilio.com'; + } + + + /** + * @return V2 Version v2 of intelligence + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Intelligence]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging.php new file mode 100644 index 0000000..c8a848f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging.php @@ -0,0 +1,42 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\IpMessaging\V2\CredentialList { + echo "credentials is deprecated. Use v2->credentials instead."; + return $this->v2->credentials; + } + + /** + * @deprecated Use v2->credentials(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCredentials(string $sid): \Twilio\Rest\IpMessaging\V2\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; + return $this->v2->credentials($sid); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\IpMessaging\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The sid + */ + protected function contextServices(string $sid): \Twilio\Rest\IpMessaging\V2\ServiceContext { + echo "services($sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1.php new file mode 100644 index 0000000..8bdce1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.IpMessaging.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php new file mode 100644 index 0000000..693ff64 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialInstance.php new file mode 100644 index 0000000..5d216b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialList.php new file mode 100644 index 0000000..aa8bb9f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialOptions.php new file mode 100644 index 0000000..5682a37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName + * @param string $certificate + * @param string $privateKey + * @param bool $sandbox + * @param string $apiKey + * @param string $secret + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $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; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialPage.php new file mode 100644 index 0000000..32a8f69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\IpMessaging\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php new file mode 100644 index 0000000..4dd8bd1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php new file mode 100644 index 0000000..335521b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php new file mode 100644 index 0000000..3aeadfd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance 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 InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + '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 InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.InviteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php new file mode 100644 index 0000000..1e7602a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php new file mode 100644 index 0000000..54537fb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.InvitePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php new file mode 100644 index 0000000..d37652d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php new file mode 100644 index 0000000..c46b98f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php new file mode 100644 index 0000000..27ca55a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + '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 MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MemberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php new file mode 100644 index 0000000..5b29dc0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php @@ -0,0 +1,202 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateMemberOptions ' . $options . ']'; + } +} + + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid + * @param int $lastConsumedMessageIndex + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php new file mode 100644 index 0000000..81fabbe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MemberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php new file mode 100644 index 0000000..d55dd02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php new file mode 100644 index 0000000..af2fef1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php @@ -0,0 +1,170 @@ +properties = [ + '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 = ['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 MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php new file mode 100644 index 0000000..e9d3db8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param string $body + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $body, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $body, + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php new file mode 100644 index 0000000..e138661 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php @@ -0,0 +1,220 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $order + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body + * @param string $attributes + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php new file mode 100644 index 0000000..8fd7c90 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php new file mode 100644 index 0000000..2b64f6e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php @@ -0,0 +1,236 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php new file mode 100644 index 0000000..8d5562d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php @@ -0,0 +1,201 @@ +properties = [ + '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 = ['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 ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php new file mode 100644 index 0000000..b8e7fa9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php @@ -0,0 +1,210 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + '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 ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php new file mode 100644 index 0000000..252f116 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php @@ -0,0 +1,272 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + +class ReadChannelOptions extends Options + { + /** + * @param string $type + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * + * + * @param string $type + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName + * @param string $uniqueName + * @param string $attributes + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php new file mode 100644 index 0000000..acfb450 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\IpMessaging\V1\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php new file mode 100644 index 0000000..69909c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php new file mode 100644 index 0000000..0d7f3a3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + '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 = ['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 RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleList.php new file mode 100644 index 0000000..a9594aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName + * @param string $type + * @param string[] $permission + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php new file mode 100644 index 0000000..f4727d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\IpMessaging\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php new file mode 100644 index 0000000..56714b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php @@ -0,0 +1,96 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserChannelInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php new file mode 100644 index 0000000..6034b75 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php @@ -0,0 +1,157 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + '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 UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $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(): string + { + return '[Twilio.IpMessaging.V1.UserChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php new file mode 100644 index 0000000..3ffcc8f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php new file mode 100644 index 0000000..bda8d09 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php new file mode 100644 index 0000000..5440e10 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php @@ -0,0 +1,181 @@ +properties = [ + '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 = ['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 UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserList.php new file mode 100644 index 0000000..3c54966 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php new file mode 100644 index 0000000..53f9770 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php @@ -0,0 +1,206 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid + * @param string $attributes + * @param string $friendlyName + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserPage.php new file mode 100644 index 0000000..bd3cb15 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\IpMessaging\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php new file mode 100644 index 0000000..37f0a37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php @@ -0,0 +1,329 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Webhooks.OnMessageSend.Url' => + $options['webhooksOnMessageSendUrl'], + 'Webhooks.OnMessageSend.Method' => + $options['webhooksOnMessageSendMethod'], + 'Webhooks.OnMessageUpdate.Url' => + $options['webhooksOnMessageUpdateUrl'], + 'Webhooks.OnMessageUpdate.Method' => + $options['webhooksOnMessageUpdateMethod'], + 'Webhooks.OnMessageRemove.Url' => + $options['webhooksOnMessageRemoveUrl'], + 'Webhooks.OnMessageRemove.Method' => + $options['webhooksOnMessageRemoveMethod'], + 'Webhooks.OnChannelAdd.Url' => + $options['webhooksOnChannelAddUrl'], + 'Webhooks.OnChannelAdd.Method' => + $options['webhooksOnChannelAddMethod'], + 'Webhooks.OnChannelDestroy.Url' => + $options['webhooksOnChannelDestroyUrl'], + 'Webhooks.OnChannelDestroy.Method' => + $options['webhooksOnChannelDestroyMethod'], + 'Webhooks.OnChannelUpdate.Url' => + $options['webhooksOnChannelUpdateUrl'], + 'Webhooks.OnChannelUpdate.Method' => + $options['webhooksOnChannelUpdateMethod'], + 'Webhooks.OnMemberAdd.Url' => + $options['webhooksOnMemberAddUrl'], + 'Webhooks.OnMemberAdd.Method' => + $options['webhooksOnMemberAddMethod'], + 'Webhooks.OnMemberRemove.Url' => + $options['webhooksOnMemberRemoveUrl'], + 'Webhooks.OnMemberRemove.Method' => + $options['webhooksOnMemberRemoveMethod'], + 'Webhooks.OnMessageSent.Url' => + $options['webhooksOnMessageSentUrl'], + 'Webhooks.OnMessageSent.Method' => + $options['webhooksOnMessageSentMethod'], + 'Webhooks.OnMessageUpdated.Url' => + $options['webhooksOnMessageUpdatedUrl'], + 'Webhooks.OnMessageUpdated.Method' => + $options['webhooksOnMessageUpdatedMethod'], + 'Webhooks.OnMessageRemoved.Url' => + $options['webhooksOnMessageRemovedUrl'], + 'Webhooks.OnMessageRemoved.Method' => + $options['webhooksOnMessageRemovedMethod'], + 'Webhooks.OnChannelAdded.Url' => + $options['webhooksOnChannelAddedUrl'], + 'Webhooks.OnChannelAdded.Method' => + $options['webhooksOnChannelAddedMethod'], + 'Webhooks.OnChannelDestroyed.Url' => + $options['webhooksOnChannelDestroyedUrl'], + 'Webhooks.OnChannelDestroyed.Method' => + $options['webhooksOnChannelDestroyedMethod'], + 'Webhooks.OnChannelUpdated.Url' => + $options['webhooksOnChannelUpdatedUrl'], + 'Webhooks.OnChannelUpdated.Method' => + $options['webhooksOnChannelUpdatedMethod'], + 'Webhooks.OnMemberAdded.Url' => + $options['webhooksOnMemberAddedUrl'], + 'Webhooks.OnMemberAdded.Method' => + $options['webhooksOnMemberAddedMethod'], + 'Webhooks.OnMemberRemoved.Url' => + $options['webhooksOnMemberRemovedUrl'], + 'Webhooks.OnMemberRemoved.Method' => + $options['webhooksOnMemberRemovedMethod'], + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceInstance.php new file mode 100644 index 0000000..0ef567e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceInstance.php @@ -0,0 +1,213 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceList.php new file mode 100644 index 0000000..35c51c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceList.php @@ -0,0 +1,187 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceOptions.php new file mode 100644 index 0000000..202514c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServiceOptions.php @@ -0,0 +1,1038 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $defaultServiceRoleSid + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelCreatorRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * + * + * @param bool $readStatusEnabled + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * + * + * @param bool $reachabilityEnabled + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * + * + * @param int $typingIndicatorTimeout + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * + * + * @param int $consumptionReportInterval + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageTemplate + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsAddedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsRemovedFromChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsInvitedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $preWebhookUrl + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * + * + * @param string $postWebhookUrl + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * + * + * @param string $webhookMethod + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * + * + * @param string[] $webhookFilters + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSendUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self + { + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSendMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self + { + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdateUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self + { + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdateMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self + { + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemoveUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self + { + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemoveMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self + { + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self + { + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self + { + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self + { + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self + { + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdateUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self + { + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdateMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self + { + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self + { + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self + { + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemoveUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self + { + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemoveMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self + { + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSentUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self + { + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSentMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self + { + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdatedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self + { + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdatedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self + { + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemovedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self + { + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemovedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self + { + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self + { + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self + { + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self + { + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self + { + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdatedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self + { + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdatedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self + { + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self + { + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self + { + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemovedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self + { + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemovedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self + { + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + return $this; + } + + /** + * + * + * @param int $limitsChannelMembers + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * + * + * @param int $limitsUserChannels + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServicePage.php new file mode 100644 index 0000000..947c774 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\IpMessaging\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2.php new file mode 100644 index 0000000..f3bf241 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2.php @@ -0,0 +1,107 @@ +version = 'v2'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.IpMessaging.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php new file mode 100644 index 0000000..c703a02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php new file mode 100644 index 0000000..b511b50 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php new file mode 100644 index 0000000..10d2fa8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php new file mode 100644 index 0000000..fe4d265 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName + * @param string $certificate + * @param string $privateKey + * @param bool $sandbox + * @param string $apiKey + * @param string $secret + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $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; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php new file mode 100644 index 0000000..e1f2236 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\IpMessaging\V2\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php new file mode 100644 index 0000000..fe22b05 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php new file mode 100644 index 0000000..213895e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php @@ -0,0 +1,152 @@ +properties = [ + '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 = ['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 BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php new file mode 100644 index 0000000..5be73d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance 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 BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + '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 BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.BindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php new file mode 100644 index 0000000..86dd074 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string $bindingType + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php new file mode 100644 index 0000000..2763796 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\IpMessaging\V2\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.BindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php new file mode 100644 index 0000000..9cc0b27 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php new file mode 100644 index 0000000..3b0a7ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + '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 = ['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 InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php new file mode 100644 index 0000000..663266e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance 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 InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + '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 InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.InviteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php new file mode 100644 index 0000000..debab9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php new file mode 100644 index 0000000..434e696 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.InvitePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php new file mode 100644 index 0000000..9b498da --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php @@ -0,0 +1,154 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php new file mode 100644 index 0000000..9a394cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + ]; + + $this->solution = ['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 MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php new file mode 100644 index 0000000..5eca4bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + '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 MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MemberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php new file mode 100644 index 0000000..8465c05 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php @@ -0,0 +1,450 @@ +options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateMemberOptions ' . $options . ']'; + } +} + +class DeleteMemberOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteMemberOptions ' . $options . ']'; + } +} + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid + * @param int $lastConsumedMessageIndex + * @param \DateTime $lastConsumptionTimestamp + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $attributes + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php new file mode 100644 index 0000000..6d476d9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MemberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php new file mode 100644 index 0000000..53fe93c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php @@ -0,0 +1,154 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'From' => + $options['from'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php new file mode 100644 index 0000000..3994375 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php @@ -0,0 +1,177 @@ +properties = [ + '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 = ['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 MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php new file mode 100644 index 0000000..e33b514 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php @@ -0,0 +1,225 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + '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 MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php new file mode 100644 index 0000000..394bc12 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php @@ -0,0 +1,468 @@ +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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $lastUpdatedBy + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $mediaSid + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body + * @param string $attributes + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $lastUpdatedBy + * @param string $from + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $lastUpdatedBy = Values::NONE, + string $from = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['from'] = $from; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $lastUpdatedBy + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php new file mode 100644 index 0000000..4d8d088 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php new file mode 100644 index 0000000..af89767 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php @@ -0,0 +1,151 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php new file mode 100644 index 0000000..60c4783 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'type' => Values::array_get($payload, 'type'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['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 WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php new file mode 100644 index 0000000..ed26981 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php @@ -0,0 +1,220 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php new file mode 100644 index 0000000..bf70282 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php @@ -0,0 +1,310 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * + * + * @param string $configurationUrl + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * + * + * @param string[] $configurationFilters + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * + * + * @param string[] $configurationTriggers + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * + * + * @param string $configurationFlowSid + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * + * + * @param int $configurationRetryCount + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl + * @param string $configurationMethod + * @param string[] $configurationFilters + * @param string[] $configurationTriggers + * @param string $configurationFlowSid + * @param int $configurationRetryCount + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE, + int $configurationRetryCount = Values::INT_NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * + * + * @param string $configurationUrl + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * + * + * @param string[] $configurationFilters + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * + * + * @param string[] $configurationTriggers + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * + * + * @param string $configurationFlowSid + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * + * + * @param int $configurationRetryCount + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php new file mode 100644 index 0000000..72482ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php new file mode 100644 index 0000000..84bfdda --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php @@ -0,0 +1,266 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php new file mode 100644 index 0000000..e6ec2b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php @@ -0,0 +1,212 @@ +properties = [ + '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 = ['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 ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php new file mode 100644 index 0000000..2cbebcc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + '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 ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php new file mode 100644 index 0000000..e47702f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php @@ -0,0 +1,466 @@ +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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $createdBy + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateChannelOptions ' . $options . ']'; + } +} + +class DeleteChannelOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteChannelOptions ' . $options . ']'; + } +} + + +class ReadChannelOptions extends Options + { + /** + * @param string $type + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * + * + * @param string $type + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName + * @param string $uniqueName + * @param string $attributes + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $createdBy + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $createdBy = Values::NONE, + string $xTwilioWebhookEnabled = 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; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $createdBy + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php new file mode 100644 index 0000000..95a9150 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\IpMessaging\V2\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php new file mode 100644 index 0000000..608eb30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php new file mode 100644 index 0000000..e821fab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + '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 = ['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 RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php new file mode 100644 index 0000000..1945dac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName + * @param string $type + * @param string[] $permission + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + '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 RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.RoleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php new file mode 100644 index 0000000..172091c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\IpMessaging\V2\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.RolePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php new file mode 100644 index 0000000..04f3163 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserBindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserBindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php new file mode 100644 index 0000000..e0ae2aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 UserBindingContext Context for this UserBindingInstance + */ + protected function proxy(): UserBindingContext + { + if (!$this->context) { + $this->context = new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php new file mode 100644 index 0000000..ee4d6c1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserBindingInstance 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 UserBindingPage Page of UserBindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserBindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + '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 UserBindingPage Page of UserBindingInstance + */ + public function getPage(string $targetUrl): UserBindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserBindingContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserBindingContext + { + return new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserBindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php new file mode 100644 index 0000000..7bfc069 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php @@ -0,0 +1,80 @@ +options['bindingType'] = $bindingType; + } + + /** + * + * + * @param string $bindingType + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadUserBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php new file mode 100644 index 0000000..1c9a24d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserBindingInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingInstance + */ + public function buildInstance(array $payload): UserBindingInstance + { + return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserBindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php new file mode 100644 index 0000000..e2498c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php @@ -0,0 +1,145 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'channelSid' => + $channelSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels/' . \rawurlencode($channelSid) + .''; + } + + /** + * Delete the UserChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php new file mode 100644 index 0000000..a273c21 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php @@ -0,0 +1,165 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserChannelContext Context for this UserChannelInstance + */ + protected function proxy(): UserChannelContext + { + if (!$this->context) { + $this->context = new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php new file mode 100644 index 0000000..8958229 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + '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 UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserChannelContext + * + * @param string $channelSid + */ + public function getContext( + string $channelSid + + ): UserChannelContext + { + return new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $channelSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php new file mode 100644 index 0000000..4b0b37f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateUserChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php new file mode 100644 index 0000000..ebf10e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php new file mode 100644 index 0000000..e0ad183 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + if (!$this->_userBindings) { + $this->_userBindings = new UserBindingList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php new file mode 100644 index 0000000..60c1f02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php @@ -0,0 +1,191 @@ +properties = [ + '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 = ['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 UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + return $this->proxy()->userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php new file mode 100644 index 0000000..7010420 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + '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 UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php new file mode 100644 index 0000000..67c4d3c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php @@ -0,0 +1,242 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid + * @param string $attributes + * @param string $friendlyName + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php new file mode 100644 index 0000000..1d105d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\IpMessaging\V2\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php new file mode 100644 index 0000000..5fb7219 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php @@ -0,0 +1,302 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php new file mode 100644 index 0000000..def8ff3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php @@ -0,0 +1,227 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php new file mode 100644 index 0000000..4ecd224 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php @@ -0,0 +1,187 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php new file mode 100644 index 0000000..ffa4c75 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php @@ -0,0 +1,624 @@ +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; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $defaultServiceRoleSid + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelCreatorRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * + * + * @param bool $readStatusEnabled + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * + * + * @param bool $reachabilityEnabled + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * + * + * @param int $typingIndicatorTimeout + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * + * + * @param int $consumptionReportInterval + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageTemplate + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageSound + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self + { + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageBadgeCountEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self + { + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + return $this; + } + + /** + * + * + * @param bool $notificationsAddedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self + { + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + return $this; + } + + /** + * + * + * @param bool $notificationsRemovedFromChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self + { + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + return $this; + } + + /** + * + * + * @param bool $notificationsInvitedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self + { + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + return $this; + } + + /** + * + * + * @param string $preWebhookUrl + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * + * + * @param string $postWebhookUrl + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * + * + * @param string $webhookMethod + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * + * + * @param string[] $webhookFilters + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * + * + * @param int $limitsChannelMembers + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * + * + * @param int $limitsUserChannels + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * + * + * @param string $mediaCompatibilityMessage + * @return $this Fluent Builder + */ + public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self + { + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + return $this; + } + + /** + * + * + * @param int $preWebhookRetryCount + * @return $this Fluent Builder + */ + public function setPreWebhookRetryCount(int $preWebhookRetryCount): self + { + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + return $this; + } + + /** + * + * + * @param int $postWebhookRetryCount + * @return $this Fluent Builder + */ + public function setPostWebhookRetryCount(int $postWebhookRetryCount): self + { + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + return $this; + } + + /** + * + * + * @param bool $notificationsLogEnabled + * @return $this Fluent Builder + */ + public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self + { + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php new file mode 100644 index 0000000..e203053 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\IpMessaging\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/IpMessagingBase.php b/vendor/twilio/sdk/src/Twilio/Rest/IpMessagingBase.php new file mode 100644 index 0000000..04ccbb1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/IpMessagingBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://ip-messaging.twilio.com'; + } + + + /** + * @return V1 Version v1 of ip-messaging + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of ip-messaging + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.IpMessaging]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups.php new file mode 100644 index 0000000..3762721 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups.php @@ -0,0 +1,25 @@ +phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Lookups\V1\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; + return $this->v1->phoneNumbers; + } + + /** + * @deprecated Use v1->phoneNumbers(\$phoneNumber) instead. + * @param string $phoneNumber The phone number to fetch in E.164 format + */ + protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Lookups\V1\PhoneNumberContext { + echo "phoneNumbers(\$phoneNumber) is deprecated. Use v1->phoneNumbers(\$phoneNumber) instead."; + return $this->v1->phoneNumbers($phoneNumber); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1.php new file mode 100644 index 0000000..60a0506 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Lookups.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php new file mode 100644 index 0000000..93dd2a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php @@ -0,0 +1,98 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + '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')); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php new file mode 100644 index 0000000..9630b09 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php @@ -0,0 +1,129 @@ +properties = [ + '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 = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php new file mode 100644 index 0000000..fc69096 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V1.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php new file mode 100644 index 0000000..c2e5289 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php @@ -0,0 +1,130 @@ +options['countryCode'] = $countryCode; + $this->options['type'] = $type; + $this->options['addOns'] = $addOns; + $this->options['addOnsData'] = $addOnsData; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. + * + * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + * + * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). + * + * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). + * @return $this Fluent Builder + */ + public function setAddOns(array $addOns): self + { + $this->options['addOns'] = $addOns; + return $this; + } + + /** + * Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. + * + * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. + * @return $this Fluent Builder + */ + public function setAddOnsData(string $addOnsData): self + { + $this->options['addOnsData'] = $addOnsData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Lookups.V1.FetchPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php new file mode 100644 index 0000000..9ce861e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Lookups\V1\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V1.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2.php new file mode 100644 index 0000000..1962d41 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2.php @@ -0,0 +1,95 @@ +version = 'v2'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Lookups.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php new file mode 100644 index 0000000..8316a67 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php @@ -0,0 +1,118 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Fields' => + $options['fields'], + 'CountryCode' => + $options['countryCode'], + 'FirstName' => + $options['firstName'], + 'LastName' => + $options['lastName'], + 'AddressLine1' => + $options['addressLine1'], + 'AddressLine2' => + $options['addressLine2'], + 'City' => + $options['city'], + 'State' => + $options['state'], + 'PostalCode' => + $options['postalCode'], + 'AddressCountryCode' => + $options['addressCountryCode'], + 'NationalId' => + $options['nationalId'], + 'DateOfBirth' => + $options['dateOfBirth'], + 'LastVerifiedDate' => + $options['lastVerifiedDate'], + 'VerificationSid' => + $options['verificationSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php new file mode 100644 index 0000000..8da1b0b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'callingCountryCode' => Values::array_get($payload, 'calling_country_code'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'nationalFormat' => Values::array_get($payload, 'national_format'), + 'valid' => Values::array_get($payload, 'valid'), + 'validationErrors' => Values::array_get($payload, 'validation_errors'), + 'callerName' => Values::array_get($payload, 'caller_name'), + 'simSwap' => Values::array_get($payload, 'sim_swap'), + 'callForwarding' => Values::array_get($payload, 'call_forwarding'), + 'lineStatus' => Values::array_get($payload, 'line_status'), + 'lineTypeIntelligence' => Values::array_get($payload, 'line_type_intelligence'), + 'identityMatch' => Values::array_get($payload, 'identity_match'), + 'reassignedNumber' => Values::array_get($payload, 'reassigned_number'), + 'smsPumpingRisk' => Values::array_get($payload, 'sms_pumping_risk'), + 'phoneNumberQualityScore' => Values::array_get($payload, 'phone_number_quality_score'), + 'preFill' => Values::array_get($payload, 'pre_fill'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberList.php new file mode 100644 index 0000000..aa39379 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V2.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php new file mode 100644 index 0000000..c832428 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php @@ -0,0 +1,310 @@ +options['fields'] = $fields; + $this->options['countryCode'] = $countryCode; + $this->options['firstName'] = $firstName; + $this->options['lastName'] = $lastName; + $this->options['addressLine1'] = $addressLine1; + $this->options['addressLine2'] = $addressLine2; + $this->options['city'] = $city; + $this->options['state'] = $state; + $this->options['postalCode'] = $postalCode; + $this->options['addressCountryCode'] = $addressCountryCode; + $this->options['nationalId'] = $nationalId; + $this->options['dateOfBirth'] = $dateOfBirth; + $this->options['lastVerifiedDate'] = $lastVerifiedDate; + $this->options['verificationSid'] = $verificationSid; + } + + /** + * A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. + * + * @param string $fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. + * @return $this Fluent Builder + */ + public function setFields(string $fields): self + { + $this->options['fields'] = $fields; + return $this; + } + + /** + * The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. + * + * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * User’s first name. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setFirstName(string $firstName): self + { + $this->options['firstName'] = $firstName; + return $this; + } + + /** + * User’s last name. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setLastName(string $lastName): self + { + $this->options['lastName'] = $lastName; + return $this; + } + + /** + * User’s first address line. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressLine1(string $addressLine1): self + { + $this->options['addressLine1'] = $addressLine1; + return $this; + } + + /** + * User’s second address line. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressLine2(string $addressLine2): self + { + $this->options['addressLine2'] = $addressLine2; + return $this; + } + + /** + * User’s city. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setCity(string $city): self + { + $this->options['city'] = $city; + return $this; + } + + /** + * User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setPostalCode(string $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressCountryCode(string $addressCountryCode): self + { + $this->options['addressCountryCode'] = $addressCountryCode; + return $this; + } + + /** + * User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setNationalId(string $nationalId): self + { + $this->options['nationalId'] = $nationalId; + return $this; + } + + /** + * User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setDateOfBirth(string $dateOfBirth): self + { + $this->options['dateOfBirth'] = $dateOfBirth; + return $this; + } + + /** + * The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + * + * @param string $lastVerifiedDate The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + * @return $this Fluent Builder + */ + public function setLastVerifiedDate(string $lastVerifiedDate): self + { + $this->options['lastVerifiedDate'] = $lastVerifiedDate; + return $this; + } + + /** + * The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + * + * @param string $verificationSid The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + * @return $this Fluent Builder + */ + public function setVerificationSid(string $verificationSid): self + { + $this->options['verificationSid'] = $verificationSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Lookups.V2.FetchPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberPage.php new file mode 100644 index 0000000..481bdd1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Lookups\V2\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V2.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/LookupsBase.php b/vendor/twilio/sdk/src/Twilio/Rest/LookupsBase.php new file mode 100644 index 0000000..af8e0b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/LookupsBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://lookups.twilio.com'; + } + + + /** + * @return V1 Version v1 of lookups + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of lookups + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Lookups]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace.php new file mode 100644 index 0000000..f0a9413 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace.php @@ -0,0 +1,5 @@ +version = 'v1'; + } + + protected function getAvailableAddOns(): AvailableAddOnList + { + if (!$this->_availableAddOns) { + $this->_availableAddOns = new AvailableAddOnList($this); + } + return $this->_availableAddOns; + } + + protected function getInstalledAddOns(): InstalledAddOnList + { + if (!$this->_installedAddOns) { + $this->_installedAddOns = new InstalledAddOnList($this); + } + return $this->_installedAddOns; + } + + protected function getModuleDataManagement(): ModuleDataManagementList + { + if (!$this->_moduleDataManagement) { + $this->_moduleDataManagement = new ModuleDataManagementList($this); + } + return $this->_moduleDataManagement; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Marketplace.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionContext.php new file mode 100644 index 0000000..ce89f9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionContext.php @@ -0,0 +1,89 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AvailableAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.AvailableAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionInstance.php new file mode 100644 index 0000000..b12e7f0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionInstance.php @@ -0,0 +1,127 @@ +properties = [ + '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 = ['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 AvailableAddOnExtensionContext Context for this AvailableAddOnExtensionInstance + */ + protected function proxy(): AvailableAddOnExtensionContext + { + if (!$this->context) { + $this->context = new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.AvailableAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionList.php new file mode 100644 index 0000000..8216e65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnExtensionPage + { + + $params = Values::of([ + '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 AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function getPage(string $targetUrl): AvailableAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnExtensionContext + * + * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnExtensionContext + { + return new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.AvailableAddOnExtensionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionPage.php new file mode 100644 index 0000000..074b766 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOn/AvailableAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnExtensionInstance \Twilio\Rest\Marketplace\V1\AvailableAddOn\AvailableAddOnExtensionInstance + */ + public function buildInstance(array $payload): AvailableAddOnExtensionInstance + { + return new AvailableAddOnExtensionInstance($this->version, $payload, $this->solution['availableAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.AvailableAddOnExtensionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnContext.php new file mode 100644 index 0000000..e47fe63 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnContext.php @@ -0,0 +1,141 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AvailableAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.AvailableAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnInstance.php new file mode 100644 index 0000000..77681b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnInstance.php @@ -0,0 +1,138 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AvailableAddOnContext Context for this AvailableAddOnInstance + */ + protected function proxy(): AvailableAddOnContext + { + if (!$this->context) { + $this->context = new AvailableAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.AvailableAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnList.php new file mode 100644 index 0000000..eee78cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/AvailableAddOns'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnPage + { + + $params = Values::of([ + '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 AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function getPage(string $targetUrl): AvailableAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnContext + * + * @param string $sid The SID of the AvailableAddOn resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnContext + { + return new AvailableAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.AvailableAddOnList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnPage.php new file mode 100644 index 0000000..7d3bcdf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/AvailableAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnInstance \Twilio\Rest\Marketplace\V1\AvailableAddOnInstance + */ + public function buildInstance(array $payload): AvailableAddOnInstance + { + return new AvailableAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.AvailableAddOnPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionContext.php new file mode 100644 index 0000000..7c079b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionContext.php @@ -0,0 +1,117 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + $data = Values::of([ + 'Enabled' => + Serialize::booleanToString($enabled), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionInstance.php new file mode 100644 index 0000000..44b9999 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionInstance.php @@ -0,0 +1,142 @@ +properties = [ + '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 = ['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 InstalledAddOnExtensionContext Context for this InstalledAddOnExtensionInstance + */ + protected function proxy(): InstalledAddOnExtensionContext + { + if (!$this->context) { + $this->context = new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.InstalledAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionList.php new file mode 100644 index 0000000..5d36ec7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnExtensionPage + { + + $params = Values::of([ + '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 InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function getPage(string $targetUrl): InstalledAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnExtensionContext + * + * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): InstalledAddOnExtensionContext + { + return new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnExtensionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionPage.php new file mode 100644 index 0000000..4014d9f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnExtensionInstance \Twilio\Rest\Marketplace\V1\InstalledAddOn\InstalledAddOnExtensionInstance + */ + public function buildInstance(array $payload): InstalledAddOnExtensionInstance + { + return new InstalledAddOnExtensionInstance($this->version, $payload, $this->solution['installedAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnExtensionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageInstance.php new file mode 100644 index 0000000..2f27ba0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageInstance.php @@ -0,0 +1,83 @@ +properties = [ + 'billableItems' => Values::array_get($payload, 'billable_items'), + 'totalSubmitted' => Values::array_get($payload, 'total_submitted'), + ]; + + $this->solution = ['installedAddOnSid' => $installedAddOnSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnUsageInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageList.php new file mode 100644 index 0000000..eee1fba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageList.php @@ -0,0 +1,82 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Usage'; + } + + /** + * Create the InstalledAddOnUsageInstance + * + * @param CreateBillingUsageRequest $createBillingUsageRequest + * @return InstalledAddOnUsageInstance Created InstalledAddOnUsageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(CreateBillingUsageRequest $createBillingUsageRequest): InstalledAddOnUsageInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $createBillingUsageRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnUsageInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnUsageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php new file mode 100644 index 0000000..c105462 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsageModels.php @@ -0,0 +1,89 @@ +quantity = Values::array_get($payload, 'quantity'); + $this->sid = Values::array_get($payload, 'sid'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'quantity' => $this->quantity, + 'sid' => $this->sid + ]; + } +} + +class CreateBillingUsageRequest implements \JsonSerializable +{ + /** + * @property CreateBillingUsageRequestBillableItems[] $billableItems + */ + protected $billableItems; + public function __construct(array $payload = []) { + $this->billableItems = Values::array_get($payload, 'billableItems'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'billableItems' => $this->billableItems + ]; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsagePage.php new file mode 100644 index 0000000..c3a7635 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnUsagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnUsageInstance \Twilio\Rest\Marketplace\V1\InstalledAddOn\InstalledAddOnUsageInstance + */ + public function buildInstance(array $payload): InstalledAddOnUsageInstance + { + return new InstalledAddOnUsageInstance($this->version, $payload, $this->solution['installedAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnUsagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnContext.php new file mode 100644 index 0000000..693e6e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnContext.php @@ -0,0 +1,205 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the usage + */ + protected function getUsage(): InstalledAddOnUsageList + { + if (!$this->_usage) { + $this->_usage = new InstalledAddOnUsageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usage; + } + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.InstalledAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnInstance.php new file mode 100644 index 0000000..c62792b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnInstance.php @@ -0,0 +1,181 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InstalledAddOnContext Context for this InstalledAddOnInstance + */ + protected function proxy(): InstalledAddOnContext + { + if (!$this->context) { + $this->context = new InstalledAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the usage + */ + protected function getUsage(): InstalledAddOnUsageList + { + return $this->proxy()->usage; + } + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.InstalledAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnList.php new file mode 100644 index 0000000..a66bb36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnList.php @@ -0,0 +1,199 @@ +solution = [ + ]; + + $this->uri = '/InstalledAddOns'; + } + + /** + * Create the InstalledAddOnInstance + * + * @param string $availableAddOnSid The SID of the AvaliableAddOn to install. + * @param bool $acceptTermsOfService Whether the Terms of Service were accepted. + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Created InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $availableAddOnSid, bool $acceptTermsOfService, array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AvailableAddOnSid' => + $availableAddOnSid, + 'AcceptTermsOfService' => + Serialize::booleanToString($acceptTermsOfService), + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnPage + { + + $params = Values::of([ + '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 InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function getPage(string $targetUrl): InstalledAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnContext + * + * @param string $sid The SID of the InstalledAddOn resource to delete. + */ + public function getContext( + string $sid + + ): InstalledAddOnContext + { + return new InstalledAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnOptions.php new file mode 100644 index 0000000..1dc357c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnOptions.php @@ -0,0 +1,170 @@ +options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The JSON object that represents the configuration of the new Add-on being installed. + * + * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Marketplace.V1.CreateInstalledAddOnOptions ' . $options . ']'; + } +} + + + + +class UpdateInstalledAddOnOptions extends Options + { + /** + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + */ + public function __construct( + + array $configuration = Values::ARRAY_NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Marketplace.V1.UpdateInstalledAddOnOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnPage.php new file mode 100644 index 0000000..6a861c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/InstalledAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnInstance \Twilio\Rest\Marketplace\V1\InstalledAddOnInstance + */ + public function buildInstance(array $payload): InstalledAddOnInstance + { + return new InstalledAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.InstalledAddOnPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementContext.php new file mode 100644 index 0000000..d67e573 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementContext.php @@ -0,0 +1,120 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Listing/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ModuleDataManagementInstance + * + * @return ModuleDataManagementInstance Fetched ModuleDataManagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModuleDataManagementInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ModuleDataManagementInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ModuleDataManagementInstance + * + * @param array|Options $options Optional Arguments + * @return ModuleDataManagementInstance Updated ModuleDataManagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModuleDataManagementInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ModuleInfo' => + $options['moduleInfo'], + 'Description' => + $options['description'], + 'Documentation' => + $options['documentation'], + 'Policies' => + $options['policies'], + 'Support' => + $options['support'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ModuleDataManagementInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.ModuleDataManagementContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementInstance.php new file mode 100644 index 0000000..303ac5a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'description' => Values::array_get($payload, 'description'), + 'support' => Values::array_get($payload, 'support'), + 'policies' => Values::array_get($payload, 'policies'), + 'moduleInfo' => Values::array_get($payload, 'module_info'), + 'documentation' => Values::array_get($payload, 'documentation'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ModuleDataManagementContext Context for this ModuleDataManagementInstance + */ + protected function proxy(): ModuleDataManagementContext + { + if (!$this->context) { + $this->context = new ModuleDataManagementContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ModuleDataManagementInstance + * + * @return ModuleDataManagementInstance Fetched ModuleDataManagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModuleDataManagementInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ModuleDataManagementInstance + * + * @param array|Options $options Optional Arguments + * @return ModuleDataManagementInstance Updated ModuleDataManagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModuleDataManagementInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Marketplace.V1.ModuleDataManagementInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementList.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementList.php new file mode 100644 index 0000000..ad82d14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a ModuleDataManagementContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ModuleDataManagementContext + { + return new ModuleDataManagementContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.ModuleDataManagementList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementOptions.php new file mode 100644 index 0000000..afa8891 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementOptions.php @@ -0,0 +1,150 @@ +options['moduleInfo'] = $moduleInfo; + $this->options['description'] = $description; + $this->options['documentation'] = $documentation; + $this->options['policies'] = $policies; + $this->options['support'] = $support; + } + + /** + * + * + * @param string $moduleInfo + * @return $this Fluent Builder + */ + public function setModuleInfo(string $moduleInfo): self + { + $this->options['moduleInfo'] = $moduleInfo; + return $this; + } + + /** + * + * + * @param string $description + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * + * + * @param string $documentation + * @return $this Fluent Builder + */ + public function setDocumentation(string $documentation): self + { + $this->options['documentation'] = $documentation; + return $this; + } + + /** + * + * + * @param string $policies + * @return $this Fluent Builder + */ + public function setPolicies(string $policies): self + { + $this->options['policies'] = $policies; + return $this; + } + + /** + * + * + * @param string $support + * @return $this Fluent Builder + */ + public function setSupport(string $support): self + { + $this->options['support'] = $support; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Marketplace.V1.UpdateModuleDataManagementOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementPage.php new file mode 100644 index 0000000..e416b82 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Marketplace/V1/ModuleDataManagementPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ModuleDataManagementInstance \Twilio\Rest\Marketplace\V1\ModuleDataManagementInstance + */ + public function buildInstance(array $payload): ModuleDataManagementInstance + { + return new ModuleDataManagementInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Marketplace.V1.ModuleDataManagementPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/MarketplaceBase.php b/vendor/twilio/sdk/src/Twilio/Rest/MarketplaceBase.php new file mode 100644 index 0000000..194269d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/MarketplaceBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://marketplace.twilio.com'; + } + + + /** + * @return V1 Version v1 of marketplace + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Marketplace]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Media.php b/vendor/twilio/sdk/src/Twilio/Rest/Media.php new file mode 100644 index 0000000..c8cefa8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Media.php @@ -0,0 +1,59 @@ +mediaProcessor instead. + */ + protected function getMediaProcessor(): \Twilio\Rest\Media\V1\MediaProcessorList { + echo "mediaProcessor is deprecated. Use v1->mediaProcessor instead."; + return $this->v1->mediaProcessor; + } + + /** + * @deprecated Use v1->mediaProcessor(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextMediaProcessor(string $sid): \Twilio\Rest\Media\V1\MediaProcessorContext { + echo "mediaProcessor(\$sid) is deprecated. Use v1->mediaProcessor(\$sid) instead."; + return $this->v1->mediaProcessor($sid); + } + + /** + * @deprecated Use v1->mediaRecording instead. + */ + protected function getMediaRecording(): \Twilio\Rest\Media\V1\MediaRecordingList { + echo "mediaRecording is deprecated. Use v1->mediaRecording instead."; + return $this->v1->mediaRecording; + } + + /** + * @deprecated Use v1->mediaRecording(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextMediaRecording(string $sid): \Twilio\Rest\Media\V1\MediaRecordingContext { + echo "mediaRecording(\$sid) is deprecated. Use v1->mediaRecording(\$sid) instead."; + return $this->v1->mediaRecording($sid); + } + + /** + * @deprecated Use v1->playerStreamer instead. + */ + protected function getPlayerStreamer(): \Twilio\Rest\Media\V1\PlayerStreamerList { + echo "playerStreamer is deprecated. Use v1->playerStreamer instead."; + return $this->v1->playerStreamer; + } + + /** + * @deprecated Use v1->playerStreamer(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextPlayerStreamer(string $sid): \Twilio\Rest\Media\V1\PlayerStreamerContext { + echo "playerStreamer(\$sid) is deprecated. Use v1->playerStreamer(\$sid) instead."; + return $this->v1->playerStreamer($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging.php new file mode 100644 index 0000000..0312a49 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging.php @@ -0,0 +1,126 @@ +brandRegistrations instead."; + return $this->v1->brandRegistrations; + } + + /** + * @deprecated + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextBrandRegistrations(string $sid): \Twilio\Rest\Messaging\V1\BrandRegistrationContext { + echo "brandRegistrations(\$sid) is deprecated. Use v1->brandRegistrations(\$sid) instead."; + return $this->v1->brandRegistrations($sid); + } + + /** + * @deprecated + */ + protected function getDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsList { + echo "deactivations is deprecated. Use v1->deactivations instead."; + return $this->v1->deactivations; + } + + /** + * @deprecated Use v1->deactivations() instead. + */ + protected function contextDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsContext { + echo "deactivations() is deprecated. Use v1->deactivations() instead."; + return $this->v1->deactivations(); + } + + /** + * @deprecated Use v1->domainCerts instead. + */ + protected function getDomainCerts(): \Twilio\Rest\Messaging\V1\DomainCertsList { + echo "domainCerts is deprecated. Use v1->domainCerts instead."; + return $this->v1->domainCerts; + } + + /** + * @deprecated Use v1->domainCerts(\$domainSid) instead. + * @param string $domainSid Unique string used to identify the domain that this + * certificate should be associated with. + */ + protected function contextDomainCerts(string $domainSid): \Twilio\Rest\Messaging\V1\DomainCertsContext { + echo "domainCerts(\$domainSid) is deprecated. Use v1->domainCerts(\$domainSid) instead."; + return $this->v1->domainCerts($domainSid); + } + + /** + * @deprecated Use v1->domainConfig instead. + */ + protected function getDomainConfig(): \Twilio\Rest\Messaging\V1\DomainConfigList { + echo "domainConfig is deprecated. Use v1->domainConfig instead."; + return $this->v1->domainConfig; + } + + /** + * @deprecated Use v1->domainConfig(\$domainSid) instead. + * @param string $domainSid Unique string used to identify the domain that this + * config should be associated with. + */ + protected function contextDomainConfig(string $domainSid): \Twilio\Rest\Messaging\V1\DomainConfigContext { + echo "domainConfig(\$domainSid) is deprecated. Use v1->domainConfig(\$domainSid) instead."; + return $this->v1->domainConfig($domainSid); + } + + /** + * @deprecated Use v1->externalCampaign instead. + */ + protected function getExternalCampaign(): \Twilio\Rest\Messaging\V1\ExternalCampaignList { + echo "externalCampaign is deprecated. Use v1->externalCampaign instead."; + return $this->v1->externalCampaign; + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Messaging\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Messaging\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } + + /** + * @deprecated Use v1->tollfreeVerifications instead. + */ + protected function getTollfreeVerifications(): \Twilio\Rest\Messaging\V1\TollfreeVerificationList { + echo "tollfreeVerifications is deprecated. Use v1->tollfreeVerifications instead."; + return $this->v1->tollfreeVerifications; + } + + /** + * @deprecated Use v1->tollfreeVerifications(\$sid) instead. + * @param string $sid Tollfree Verification Sid + */ + protected function contextTollfreeVerifications(string $sid): \Twilio\Rest\Messaging\V1\TollfreeVerificationContext { + echo "tollfreeVerifications(\$sid) is deprecated. Use v1->tollfreeVerifications(\$sid) instead."; + return $this->v1->tollfreeVerifications($sid); + } + + /** + * @deprecated Use v1->usecases instead. + */ + protected function getUsecases(): \Twilio\Rest\Messaging\V1\UsecaseList { + echo "usecases is deprecated. Use v1->usecases instead."; + return $this->v1->usecases; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1.php new file mode 100644 index 0000000..c814809 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1.php @@ -0,0 +1,208 @@ +version = 'v1'; + } + + protected function getBrandRegistrations(): BrandRegistrationList + { + if (!$this->_brandRegistrations) { + $this->_brandRegistrations = new BrandRegistrationList($this); + } + return $this->_brandRegistrations; + } + + protected function getDeactivations(): DeactivationsList + { + if (!$this->_deactivations) { + $this->_deactivations = new DeactivationsList($this); + } + return $this->_deactivations; + } + + protected function getDomainCerts(): DomainCertsList + { + if (!$this->_domainCerts) { + $this->_domainCerts = new DomainCertsList($this); + } + return $this->_domainCerts; + } + + protected function getDomainConfig(): DomainConfigList + { + if (!$this->_domainConfig) { + $this->_domainConfig = new DomainConfigList($this); + } + return $this->_domainConfig; + } + + protected function getDomainConfigMessagingService(): DomainConfigMessagingServiceList + { + if (!$this->_domainConfigMessagingService) { + $this->_domainConfigMessagingService = new DomainConfigMessagingServiceList($this); + } + return $this->_domainConfigMessagingService; + } + + protected function getExternalCampaign(): ExternalCampaignList + { + if (!$this->_externalCampaign) { + $this->_externalCampaign = new ExternalCampaignList($this); + } + return $this->_externalCampaign; + } + + protected function getLinkshorteningMessagingService(): LinkshorteningMessagingServiceList + { + if (!$this->_linkshorteningMessagingService) { + $this->_linkshorteningMessagingService = new LinkshorteningMessagingServiceList($this); + } + return $this->_linkshorteningMessagingService; + } + + protected function getLinkshorteningMessagingServiceDomainAssociation(): LinkshorteningMessagingServiceDomainAssociationList + { + if (!$this->_linkshorteningMessagingServiceDomainAssociation) { + $this->_linkshorteningMessagingServiceDomainAssociation = new LinkshorteningMessagingServiceDomainAssociationList($this); + } + return $this->_linkshorteningMessagingServiceDomainAssociation; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getTollfreeVerifications(): TollfreeVerificationList + { + if (!$this->_tollfreeVerifications) { + $this->_tollfreeVerifications = new TollfreeVerificationList($this); + } + return $this->_tollfreeVerifications; + } + + protected function getUsecases(): UsecaseList + { + if (!$this->_usecases) { + $this->_usecases = new UsecaseList($this); + } + return $this->_usecases; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Messaging.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php new file mode 100644 index 0000000..b47f748 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php @@ -0,0 +1,83 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), + ]; + + $this->solution = ['brandRegistrationSid' => $brandRegistrationSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php new file mode 100644 index 0000000..ebeb1df --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php @@ -0,0 +1,79 @@ +solution = [ + 'brandRegistrationSid' => + $brandRegistrationSid, + + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandRegistrationSid) + .'/SmsOtp'; + } + + /** + * Create the BrandRegistrationOtpInstance + * + * @return BrandRegistrationOtpInstance Created BrandRegistrationOtpInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BrandRegistrationOtpInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new BrandRegistrationOtpInstance( + $this->version, + $payload, + $this->solution['brandRegistrationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php new file mode 100644 index 0000000..0d2300e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandRegistrationOtpInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpInstance + */ + public function buildInstance(array $payload): BrandRegistrationOtpInstance + { + return new BrandRegistrationOtpInstance($this->version, $payload, $this->solution['brandRegistrationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php new file mode 100644 index 0000000..a51d29b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php @@ -0,0 +1,89 @@ +solution = [ + 'brandSid' => + $brandSid, + 'brandVettingSid' => + $brandVettingSid, + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) + .'/Vettings/' . \rawurlencode($brandVettingSid) + .''; + } + + /** + * Fetch the BrandVettingInstance + * + * @return BrandVettingInstance Fetched BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandVettingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BrandVettingInstance( + $this->version, + $payload, + $this->solution['brandSid'], + $this->solution['brandVettingSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandVettingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php new file mode 100644 index 0000000..f892486 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandSid' => Values::array_get($payload, 'brand_sid'), + 'brandVettingSid' => Values::array_get($payload, 'brand_vetting_sid'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'vettingId' => Values::array_get($payload, 'vetting_id'), + 'vettingClass' => Values::array_get($payload, 'vetting_class'), + 'vettingStatus' => Values::array_get($payload, 'vetting_status'), + 'vettingProvider' => Values::array_get($payload, 'vetting_provider'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['brandSid' => $brandSid, 'brandVettingSid' => $brandVettingSid ?: $this->properties['brandVettingSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BrandVettingContext Context for this BrandVettingInstance + */ + protected function proxy(): BrandVettingContext + { + if (!$this->context) { + $this->context = new BrandVettingContext( + $this->version, + $this->solution['brandSid'], + $this->solution['brandVettingSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BrandVettingInstance + * + * @return BrandVettingInstance Fetched BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandVettingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandVettingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php new file mode 100644 index 0000000..4057a96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php @@ -0,0 +1,207 @@ +solution = [ + 'brandSid' => + $brandSid, + + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) + .'/Vettings'; + } + + /** + * Create the BrandVettingInstance + * + * @param string $vettingProvider + * @param array|Options $options Optional Arguments + * @return BrandVettingInstance Created BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $vettingProvider, array $options = []): BrandVettingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VettingProvider' => + $vettingProvider, + 'VettingId' => + $options['vettingId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BrandVettingInstance( + $this->version, + $payload, + $this->solution['brandSid'] + ); + } + + + /** + * Reads BrandVettingInstance 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 BrandVettingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BrandVettingInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BrandVettingInstance 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 BrandVettingPage Page of BrandVettingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BrandVettingPage + { + $options = new Values($options); + + $params = Values::of([ + 'VettingProvider' => + $options['vettingProvider'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BrandVettingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BrandVettingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BrandVettingPage Page of BrandVettingInstance + */ + public function getPage(string $targetUrl): BrandVettingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BrandVettingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BrandVettingContext + * + * @param string $brandVettingSid The Twilio SID of the third-party vetting record. + */ + public function getContext( + string $brandVettingSid + + ): BrandVettingContext + { + return new BrandVettingContext( + $this->version, + $this->solution['brandSid'], + $brandVettingSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandVettingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php new file mode 100644 index 0000000..c35191c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php @@ -0,0 +1,130 @@ +options['vettingId'] = $vettingId; + } + + /** + * The unique ID of the vetting + * + * @param string $vettingId The unique ID of the vetting + * @return $this Fluent Builder + */ + public function setVettingId(string $vettingId): self + { + $this->options['vettingId'] = $vettingId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateBrandVettingOptions ' . $options . ']'; + } +} + + +class ReadBrandVettingOptions extends Options + { + /** + * @param string $vettingProvider The third-party provider of the vettings to read + */ + public function __construct( + + string $vettingProvider = Values::NONE + + ) { + $this->options['vettingProvider'] = $vettingProvider; + } + + /** + * The third-party provider of the vettings to read + * + * @param string $vettingProvider The third-party provider of the vettings to read + * @return $this Fluent Builder + */ + public function setVettingProvider(string $vettingProvider): self + { + $this->options['vettingProvider'] = $vettingProvider; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.ReadBrandVettingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php new file mode 100644 index 0000000..712030e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandVettingInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingInstance + */ + public function buildInstance(array $payload): BrandVettingInstance + { + return new BrandVettingInstance($this->version, $payload, $this->solution['brandSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandVettingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php new file mode 100644 index 0000000..d4c474a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php @@ -0,0 +1,179 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Fetched BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandRegistrationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BrandRegistrationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Updated BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): BrandRegistrationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new BrandRegistrationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the brandRegistrationOtps + */ + protected function getBrandRegistrationOtps(): BrandRegistrationOtpList + { + if (!$this->_brandRegistrationOtps) { + $this->_brandRegistrationOtps = new BrandRegistrationOtpList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_brandRegistrationOtps; + } + + /** + * Access the brandVettings + */ + protected function getBrandVettings(): BrandVettingList + { + if (!$this->_brandVettings) { + $this->_brandVettings = new BrandVettingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_brandVettings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandRegistrationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php new file mode 100644 index 0000000..17653ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php @@ -0,0 +1,189 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'customerProfileBundleSid' => Values::array_get($payload, 'customer_profile_bundle_sid'), + 'a2PProfileBundleSid' => Values::array_get($payload, 'a2p_profile_bundle_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'brandType' => Values::array_get($payload, 'brand_type'), + 'status' => Values::array_get($payload, 'status'), + 'tcrId' => Values::array_get($payload, 'tcr_id'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'errors' => Values::array_get($payload, 'errors'), + 'url' => Values::array_get($payload, 'url'), + 'brandScore' => Values::array_get($payload, 'brand_score'), + 'brandFeedback' => Values::array_get($payload, 'brand_feedback'), + 'identityStatus' => Values::array_get($payload, 'identity_status'), + 'russell3000' => Values::array_get($payload, 'russell_3000'), + 'governmentEntity' => Values::array_get($payload, 'government_entity'), + 'taxExemptStatus' => Values::array_get($payload, 'tax_exempt_status'), + 'skipAutomaticSecVet' => Values::array_get($payload, 'skip_automatic_sec_vet'), + 'mock' => Values::array_get($payload, 'mock'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BrandRegistrationContext Context for this BrandRegistrationInstance + */ + protected function proxy(): BrandRegistrationContext + { + if (!$this->context) { + $this->context = new BrandRegistrationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Fetched BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandRegistrationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Updated BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): BrandRegistrationInstance + { + + return $this->proxy()->update(); + } + + /** + * Access the brandRegistrationOtps + */ + protected function getBrandRegistrationOtps(): BrandRegistrationOtpList + { + return $this->proxy()->brandRegistrationOtps; + } + + /** + * Access the brandVettings + */ + protected function getBrandVettings(): BrandVettingList + { + return $this->proxy()->brandVettings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandRegistrationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationList.php new file mode 100644 index 0000000..e8e1996 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationList.php @@ -0,0 +1,201 @@ +solution = [ + ]; + + $this->uri = '/a2p/BrandRegistrations'; + } + + /** + * Create the BrandRegistrationInstance + * + * @param string $customerProfileBundleSid Customer Profile Bundle Sid. + * @param string $a2PProfileBundleSid A2P Messaging Profile Bundle Sid. + * @param array|Options $options Optional Arguments + * @return BrandRegistrationInstance Created BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $customerProfileBundleSid, string $a2PProfileBundleSid, array $options = []): BrandRegistrationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CustomerProfileBundleSid' => + $customerProfileBundleSid, + 'A2PProfileBundleSid' => + $a2PProfileBundleSid, + 'BrandType' => + $options['brandType'], + 'Mock' => + Serialize::booleanToString($options['mock']), + 'SkipAutomaticSecVet' => + Serialize::booleanToString($options['skipAutomaticSecVet']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BrandRegistrationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads BrandRegistrationInstance 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 BrandRegistrationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BrandRegistrationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BrandRegistrationInstance 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 BrandRegistrationPage Page of BrandRegistrationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BrandRegistrationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BrandRegistrationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BrandRegistrationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BrandRegistrationPage Page of BrandRegistrationInstance + */ + public function getPage(string $targetUrl): BrandRegistrationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BrandRegistrationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BrandRegistrationContext + * + * @param string $sid The SID of the Brand Registration resource to fetch. + */ + public function getContext( + string $sid + + ): BrandRegistrationContext + { + return new BrandRegistrationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php new file mode 100644 index 0000000..67c8e6d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php @@ -0,0 +1,118 @@ +options['brandType'] = $brandType; + $this->options['mock'] = $mock; + $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; + } + + /** + * Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. + * + * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. + * @return $this Fluent Builder + */ + public function setBrandType(string $brandType): self + { + $this->options['brandType'] = $brandType; + return $this; + } + + /** + * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. + * + * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. + * @return $this Fluent Builder + */ + public function setMock(bool $mock): self + { + $this->options['mock'] = $mock; + return $this; + } + + /** + * A flag to disable automatic secondary vetting for brands which it would otherwise be done. + * + * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. + * @return $this Fluent Builder + */ + public function setSkipAutomaticSecVet(bool $skipAutomaticSecVet): self + { + $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateBrandRegistrationOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php new file mode 100644 index 0000000..893792b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandRegistrationInstance \Twilio\Rest\Messaging\V1\BrandRegistrationInstance + */ + public function buildInstance(array $payload): BrandRegistrationInstance + { + return new BrandRegistrationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php new file mode 100644 index 0000000..bfa1a26 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php @@ -0,0 +1,87 @@ +solution = [ + ]; + + $this->uri = '/Deactivations'; + } + + /** + * Fetch the DeactivationsInstance + * + * @param array|Options $options Optional Arguments + * @return DeactivationsInstance Fetched DeactivationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): DeactivationsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Date' => + Serialize::iso8601Date($options['date']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new DeactivationsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DeactivationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsInstance.php new file mode 100644 index 0000000..f20d296 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsInstance.php @@ -0,0 +1,115 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeactivationsContext Context for this DeactivationsInstance + */ + protected function proxy(): DeactivationsContext + { + if (!$this->context) { + $this->context = new DeactivationsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the DeactivationsInstance + * + * @param array|Options $options Optional Arguments + * @return DeactivationsInstance Fetched DeactivationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): DeactivationsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DeactivationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsList.php new file mode 100644 index 0000000..b92e31d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a DeactivationsContext + */ + public function getContext( + + ): DeactivationsContext + { + return new DeactivationsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DeactivationsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsOptions.php new file mode 100644 index 0000000..450f782 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsOptions.php @@ -0,0 +1,76 @@ +options['date'] = $date; + } + + /** + * The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. + * + * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. + * @return $this Fluent Builder + */ + public function setDate(\DateTime $date): self + { + $this->options['date'] = $date; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.FetchDeactivationsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsPage.php new file mode 100644 index 0000000..5c00ca0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DeactivationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeactivationsInstance \Twilio\Rest\Messaging\V1\DeactivationsInstance + */ + public function buildInstance(array $payload): DeactivationsInstance + { + return new DeactivationsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DeactivationsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php new file mode 100644 index 0000000..26d18d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php @@ -0,0 +1,123 @@ +solution = [ + 'domainSid' => + $domainSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/Certificate'; + } + + /** + * Delete the DomainCertsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DomainCertsInstance + * + * @return DomainCertsInstance Fetched DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainCertsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DomainCertsInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Update the DomainCertsInstance + * + * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. + * @return DomainCertsInstance Updated DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $tlsCert): DomainCertsInstance + { + + $data = Values::of([ + 'TlsCert' => + $tlsCert, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DomainCertsInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainCertsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsInstance.php new file mode 100644 index 0000000..d391dde --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsInstance.php @@ -0,0 +1,155 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'certificateSid' => Values::array_get($payload, 'certificate_sid'), + 'url' => Values::array_get($payload, 'url'), + 'certInValidation' => Values::array_get($payload, 'cert_in_validation'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainCertsContext Context for this DomainCertsInstance + */ + protected function proxy(): DomainCertsContext + { + if (!$this->context) { + $this->context = new DomainCertsContext( + $this->version, + $this->solution['domainSid'] + ); + } + + return $this->context; + } + + /** + * Delete the DomainCertsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DomainCertsInstance + * + * @return DomainCertsInstance Fetched DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainCertsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainCertsInstance + * + * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. + * @return DomainCertsInstance Updated DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $tlsCert): DomainCertsInstance + { + + return $this->proxy()->update($tlsCert); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainCertsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsList.php new file mode 100644 index 0000000..9dbdcd6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainCertsContext + * + * @param string $domainSid Unique string used to identify the domain that this certificate should be associated with. + */ + public function getContext( + string $domainSid + + ): DomainCertsContext + { + return new DomainCertsContext( + $this->version, + $domainSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainCertsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsPage.php new file mode 100644 index 0000000..6799392 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainCertsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainCertsInstance \Twilio\Rest\Messaging\V1\DomainCertsInstance + */ + public function buildInstance(array $payload): DomainCertsInstance + { + return new DomainCertsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainCertsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php new file mode 100644 index 0000000..a6a3358 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php @@ -0,0 +1,119 @@ +solution = [ + 'domainSid' => + $domainSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/Config'; + } + + /** + * Fetch the DomainConfigInstance + * + * @return DomainConfigInstance Fetched DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DomainConfigInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Update the DomainConfigInstance + * + * @param array|Options $options Optional Arguments + * @return DomainConfigInstance Updated DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainConfigInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FallbackUrl' => + $options['fallbackUrl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'ContinueOnFailure' => + Serialize::booleanToString($options['continueOnFailure']), + 'DisableHttps' => + Serialize::booleanToString($options['disableHttps']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DomainConfigInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigInstance.php new file mode 100644 index 0000000..5b3daaa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'configSid' => Values::array_get($payload, 'config_sid'), + 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'disableHttps' => Values::array_get($payload, 'disable_https'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainConfigContext Context for this DomainConfigInstance + */ + protected function proxy(): DomainConfigContext + { + if (!$this->context) { + $this->context = new DomainConfigContext( + $this->version, + $this->solution['domainSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DomainConfigInstance + * + * @return DomainConfigInstance Fetched DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainConfigInstance + * + * @param array|Options $options Optional Arguments + * @return DomainConfigInstance Updated DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainConfigInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigList.php new file mode 100644 index 0000000..6fd9ed6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainConfigContext + * + * @param string $domainSid Unique string used to identify the domain that this config should be associated with. + */ + public function getContext( + string $domainSid + + ): DomainConfigContext + { + return new DomainConfigContext( + $this->version, + $domainSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php new file mode 100644 index 0000000..33d1539 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php @@ -0,0 +1,83 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + ]; + + $this->uri = '/LinkShortening/MessagingService/' . \rawurlencode($messagingServiceSid) + .'/DomainConfig'; + } + + /** + * Fetch the DomainConfigMessagingServiceInstance + * + * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigMessagingServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DomainConfigMessagingServiceInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php new file mode 100644 index 0000000..23e0803 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'configSid' => Values::array_get($payload, 'config_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), + '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 = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainConfigMessagingServiceContext Context for this DomainConfigMessagingServiceInstance + */ + protected function proxy(): DomainConfigMessagingServiceContext + { + if (!$this->context) { + $this->context = new DomainConfigMessagingServiceContext( + $this->version, + $this->solution['messagingServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DomainConfigMessagingServiceInstance + * + * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigMessagingServiceInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php new file mode 100644 index 0000000..0f07fc8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainConfigMessagingServiceContext + * + * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. + */ + public function getContext( + string $messagingServiceSid + + ): DomainConfigMessagingServiceContext + { + return new DomainConfigMessagingServiceContext( + $this->version, + $messagingServiceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php new file mode 100644 index 0000000..00b75e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainConfigMessagingServiceInstance \Twilio\Rest\Messaging\V1\DomainConfigMessagingServiceInstance + */ + public function buildInstance(array $payload): DomainConfigMessagingServiceInstance + { + return new DomainConfigMessagingServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigMessagingServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigOptions.php new file mode 100644 index 0000000..05d4c7f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigOptions.php @@ -0,0 +1,132 @@ +options['fallbackUrl'] = $fallbackUrl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['continueOnFailure'] = $continueOnFailure; + $this->options['disableHttps'] = $disableHttps; + } + + /** + * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + * + * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * URL to receive click events to your webhook whenever the recipients click on the shortened links + * + * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Boolean field to set customer delivery preference when there is a failure in linkShortening service + * + * @param bool $continueOnFailure Boolean field to set customer delivery preference when there is a failure in linkShortening service + * @return $this Fluent Builder + */ + public function setContinueOnFailure(bool $continueOnFailure): self + { + $this->options['continueOnFailure'] = $continueOnFailure; + return $this; + } + + /** + * Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. + * + * @param bool $disableHttps Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. + * @return $this Fluent Builder + */ + public function setDisableHttps(bool $disableHttps): self + { + $this->options['disableHttps'] = $disableHttps; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateDomainConfigOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigPage.php new file mode 100644 index 0000000..2a84d05 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/DomainConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainConfigInstance \Twilio\Rest\Messaging\V1\DomainConfigInstance + */ + public function buildInstance(array $payload): DomainConfigInstance + { + return new DomainConfigInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php new file mode 100644 index 0000000..3cf1441 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'campaignId' => Values::array_get($payload, 'campaign_id'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignList.php new file mode 100644 index 0000000..1cba1a8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignList.php @@ -0,0 +1,81 @@ +solution = [ + ]; + + $this->uri = '/Services/PreregisteredUsa2p'; + } + + /** + * Create the ExternalCampaignInstance + * + * @param string $campaignId ID of the preregistered campaign. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. + * @return ExternalCampaignInstance Created ExternalCampaignInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $campaignId, string $messagingServiceSid): ExternalCampaignInstance + { + + $data = Values::of([ + 'CampaignId' => + $campaignId, + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ExternalCampaignInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php new file mode 100644 index 0000000..7419f52 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExternalCampaignInstance \Twilio\Rest\Messaging\V1\ExternalCampaignInstance + */ + public function buildInstance(array $payload): ExternalCampaignInstance + { + return new ExternalCampaignInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php new file mode 100644 index 0000000..93a0782 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php @@ -0,0 +1,103 @@ +solution = [ + 'domainSid' => + $domainSid, + 'messagingServiceSid' => + $messagingServiceSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/MessagingServices/' . \rawurlencode($messagingServiceSid) + .''; + } + + /** + * Create the LinkshorteningMessagingServiceInstance + * + * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): LinkshorteningMessagingServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new LinkshorteningMessagingServiceInstance( + $this->version, + $payload, + $this->solution['domainSid'], + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Delete the LinkshorteningMessagingServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php new file mode 100644 index 0000000..6c46d72 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php @@ -0,0 +1,83 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + ]; + + $this->uri = '/LinkShortening/MessagingServices/' . \rawurlencode($messagingServiceSid) + .'/Domain'; + } + + /** + * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance + * + * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new LinkshorteningMessagingServiceDomainAssociationInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationInstance.php new file mode 100644 index 0000000..424a72c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationInstance.php @@ -0,0 +1,119 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return LinkshorteningMessagingServiceDomainAssociationContext Context for this LinkshorteningMessagingServiceDomainAssociationInstance + */ + protected function proxy(): LinkshorteningMessagingServiceDomainAssociationContext + { + if (!$this->context) { + $this->context = new LinkshorteningMessagingServiceDomainAssociationContext( + $this->version, + $this->solution['messagingServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance + * + * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationList.php new file mode 100644 index 0000000..5e16015 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a LinkshorteningMessagingServiceDomainAssociationContext + * + * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. + */ + public function getContext( + string $messagingServiceSid + + ): LinkshorteningMessagingServiceDomainAssociationContext + { + return new LinkshorteningMessagingServiceDomainAssociationContext( + $this->version, + $messagingServiceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationPage.php new file mode 100644 index 0000000..9096ff3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LinkshorteningMessagingServiceDomainAssociationInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceDomainAssociationInstance + */ + public function buildInstance(array $payload): LinkshorteningMessagingServiceDomainAssociationInstance + { + return new LinkshorteningMessagingServiceDomainAssociationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php new file mode 100644 index 0000000..ea9d535 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], 'messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return LinkshorteningMessagingServiceContext Context for this LinkshorteningMessagingServiceInstance + */ + protected function proxy(): LinkshorteningMessagingServiceContext + { + if (!$this->context) { + $this->context = new LinkshorteningMessagingServiceContext( + $this->version, + $this->solution['domainSid'], + $this->solution['messagingServiceSid'] + ); + } + + return $this->context; + } + + /** + * Create the LinkshorteningMessagingServiceInstance + * + * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): LinkshorteningMessagingServiceInstance + { + + return $this->proxy()->create(); + } + + /** + * Delete the LinkshorteningMessagingServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php new file mode 100644 index 0000000..4dd47c0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a LinkshorteningMessagingServiceContext + * + * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain + * + * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain + */ + public function getContext( + string $domainSid + , string $messagingServiceSid + + ): LinkshorteningMessagingServiceContext + { + return new LinkshorteningMessagingServiceContext( + $this->version, + $domainSid, + $messagingServiceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php new file mode 100644 index 0000000..97291b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LinkshorteningMessagingServiceInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceInstance + */ + public function buildInstance(array $payload): LinkshorteningMessagingServiceInstance + { + return new LinkshorteningMessagingServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php new file mode 100644 index 0000000..bab8c1a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AlphaSenders/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AlphaSenderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AlphaSenderInstance + * + * @return AlphaSenderInstance Fetched AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlphaSenderInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AlphaSenderInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.AlphaSenderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php new file mode 100644 index 0000000..5a11b1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php @@ -0,0 +1,144 @@ +properties = [ + '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 = ['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 AlphaSenderContext Context for this AlphaSenderInstance + */ + protected function proxy(): AlphaSenderContext + { + if (!$this->context) { + $this->context = new AlphaSenderContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AlphaSenderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AlphaSenderInstance + * + * @return AlphaSenderInstance Fetched AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlphaSenderInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.AlphaSenderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php new file mode 100644 index 0000000..948c397 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AlphaSenders'; + } + + /** + * Create the AlphaSenderInstance + * + * @param string $alphaSender The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. + * @return AlphaSenderInstance Created AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $alphaSender): AlphaSenderInstance + { + + $data = Values::of([ + 'AlphaSender' => + $alphaSender, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AlphaSenderInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AlphaSenderPage Page of AlphaSenderInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AlphaSenderPage + { + + $params = Values::of([ + '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 AlphaSenderPage Page of AlphaSenderInstance + */ + public function getPage(string $targetUrl): AlphaSenderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AlphaSenderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AlphaSenderContext + * + * @param string $sid The SID of the AlphaSender resource to delete. + */ + public function getContext( + string $sid + + ): AlphaSenderContext + { + return new AlphaSenderContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.AlphaSenderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php new file mode 100644 index 0000000..a74fc77 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AlphaSenderInstance \Twilio\Rest\Messaging\V1\Service\AlphaSenderInstance + */ + public function buildInstance(array $payload): AlphaSenderInstance + { + return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.AlphaSenderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php new file mode 100644 index 0000000..3ac0ddf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php @@ -0,0 +1,89 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/ChannelSenders/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ChannelSenderInstance + * + * @return ChannelSenderInstance Fetched ChannelSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelSenderInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChannelSenderInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ChannelSenderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderInstance.php new file mode 100644 index 0000000..2ea96f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'sender' => Values::array_get($payload, 'sender'), + 'senderType' => Values::array_get($payload, 'sender_type'), + 'countryCode' => Values::array_get($payload, 'country_code'), + '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 = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelSenderContext Context for this ChannelSenderInstance + */ + protected function proxy(): ChannelSenderContext + { + if (!$this->context) { + $this->context = new ChannelSenderContext( + $this->version, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ChannelSenderInstance + * + * @return ChannelSenderInstance Fetched ChannelSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelSenderInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ChannelSenderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderList.php new file mode 100644 index 0000000..8c077ec --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderList.php @@ -0,0 +1,168 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/ChannelSenders'; + } + + /** + * Reads ChannelSenderInstance 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 ChannelSenderInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ChannelSenderInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelSenderInstance 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 ChannelSenderPage Page of ChannelSenderInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelSenderPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelSenderPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelSenderInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelSenderPage Page of ChannelSenderInstance + */ + public function getPage(string $targetUrl): ChannelSenderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelSenderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelSenderContext + * + * @param string $sid The SID of the ChannelSender resource to fetch. + */ + public function getContext( + string $sid + + ): ChannelSenderContext + { + return new ChannelSenderContext( + $this->version, + $this->solution['messagingServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ChannelSenderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderPage.php new file mode 100644 index 0000000..b5b83d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelSenderInstance \Twilio\Rest\Messaging\V1\Service\ChannelSenderInstance + */ + public function buildInstance(array $payload): ChannelSenderInstance + { + return new ChannelSenderInstance($this->version, $payload, $this->solution['messagingServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ChannelSenderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php new file mode 100644 index 0000000..d3e3a2a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php new file mode 100644 index 0000000..d0d642c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php @@ -0,0 +1,146 @@ +properties = [ + '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 = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php new file mode 100644 index 0000000..802e5b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param string $phoneNumberSid The SID of the Phone Number being added to the Service. + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumberSid): PhoneNumberInstance + { + + $data = Values::of([ + 'PhoneNumberSid' => + $phoneNumberSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + '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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The SID of the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php new file mode 100644 index 0000000..d916819 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Messaging\V1\Service\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php new file mode 100644 index 0000000..ffbb73e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php new file mode 100644 index 0000000..bd96cce --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php @@ -0,0 +1,146 @@ +properties = [ + '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 = ['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 ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php new file mode 100644 index 0000000..c1dec2f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes'; + } + + /** + * Create the ShortCodeInstance + * + * @param string $shortCodeSid The SID of the ShortCode resource being added to the Service. + * @return ShortCodeInstance Created ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $shortCodeSid): ShortCodeInstance + { + + $data = Values::of([ + 'ShortCodeSid' => + $shortCodeSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ShortCodePage Page of ShortCodeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + + $params = Values::of([ + '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 ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The SID of the ShortCode resource to delete. + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ShortCodeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php new file mode 100644 index 0000000..2b67551 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Messaging\V1\Service\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ShortCodePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php new file mode 100644 index 0000000..c2053eb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php @@ -0,0 +1,149 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UsAppToPersonInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UsAppToPersonInstance + * + * @return UsAppToPersonInstance Fetched UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsAppToPersonInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UsAppToPersonInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UsAppToPersonInstance + * + * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. + * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. + * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + * @param bool $ageGated A boolean that specifies whether campaign requires age gate for federally legal content. + * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. + * @return UsAppToPersonInstance Updated UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $messageSamples, string $messageFlow, string $description, bool $ageGated, bool $directLending): UsAppToPersonInstance + { + + $data = Values::of([ + 'HasEmbeddedLinks' => + Serialize::booleanToString($hasEmbeddedLinks), + 'HasEmbeddedPhone' => + Serialize::booleanToString($hasEmbeddedPhone), + 'MessageSamples' => + Serialize::map($messageSamples,function ($e) { return $e; }), + 'MessageFlow' => + $messageFlow, + 'Description' => + $description, + 'AgeGated' => + Serialize::booleanToString($ageGated), + 'DirectLending' => + Serialize::booleanToString($directLending), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UsAppToPersonInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.UsAppToPersonContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php new file mode 100644 index 0000000..3c44967 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'description' => Values::array_get($payload, 'description'), + 'messageSamples' => Values::array_get($payload, 'message_samples'), + 'usAppToPersonUsecase' => Values::array_get($payload, 'us_app_to_person_usecase'), + 'hasEmbeddedLinks' => Values::array_get($payload, 'has_embedded_links'), + 'hasEmbeddedPhone' => Values::array_get($payload, 'has_embedded_phone'), + 'subscriberOptIn' => Values::array_get($payload, 'subscriber_opt_in'), + 'ageGated' => Values::array_get($payload, 'age_gated'), + 'directLending' => Values::array_get($payload, 'direct_lending'), + 'campaignStatus' => Values::array_get($payload, 'campaign_status'), + 'campaignId' => Values::array_get($payload, 'campaign_id'), + 'isExternallyRegistered' => Values::array_get($payload, 'is_externally_registered'), + 'rateLimits' => Values::array_get($payload, 'rate_limits'), + 'messageFlow' => Values::array_get($payload, 'message_flow'), + 'optInMessage' => Values::array_get($payload, 'opt_in_message'), + 'optOutMessage' => Values::array_get($payload, 'opt_out_message'), + 'helpMessage' => Values::array_get($payload, 'help_message'), + 'optInKeywords' => Values::array_get($payload, 'opt_in_keywords'), + 'optOutKeywords' => Values::array_get($payload, 'opt_out_keywords'), + 'helpKeywords' => Values::array_get($payload, 'help_keywords'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'mock' => Values::array_get($payload, 'mock'), + 'errors' => Values::array_get($payload, 'errors'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UsAppToPersonContext Context for this UsAppToPersonInstance + */ + protected function proxy(): UsAppToPersonContext + { + if (!$this->context) { + $this->context = new UsAppToPersonContext( + $this->version, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UsAppToPersonInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UsAppToPersonInstance + * + * @return UsAppToPersonInstance Fetched UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsAppToPersonInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UsAppToPersonInstance + * + * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. + * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. + * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + * @param bool $ageGated A boolean that specifies whether campaign requires age gate for federally legal content. + * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. + * @return UsAppToPersonInstance Updated UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $messageSamples, string $messageFlow, string $description, bool $ageGated, bool $directLending): UsAppToPersonInstance + { + + return $this->proxy()->update($hasEmbeddedLinks, $hasEmbeddedPhone, $messageSamples, $messageFlow, $description, $ageGated, $directLending); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.UsAppToPersonInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php new file mode 100644 index 0000000..ebe7425 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php @@ -0,0 +1,236 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p'; + } + + /** + * Create the UsAppToPersonInstance + * + * @param string $brandRegistrationSid A2P Brand Registration SID + * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + * @param string $usAppToPersonUsecase A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] + * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. + * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. + * @param array|Options $options Optional Arguments + * @return UsAppToPersonInstance Created UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $brandRegistrationSid, string $description, string $messageFlow, array $messageSamples, string $usAppToPersonUsecase, bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $options = []): UsAppToPersonInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BrandRegistrationSid' => + $brandRegistrationSid, + 'Description' => + $description, + 'MessageFlow' => + $messageFlow, + 'MessageSamples' => + Serialize::map($messageSamples,function ($e) { return $e; }), + 'UsAppToPersonUsecase' => + $usAppToPersonUsecase, + 'HasEmbeddedLinks' => + Serialize::booleanToString($hasEmbeddedLinks), + 'HasEmbeddedPhone' => + Serialize::booleanToString($hasEmbeddedPhone), + 'OptInMessage' => + $options['optInMessage'], + 'OptOutMessage' => + $options['optOutMessage'], + 'HelpMessage' => + $options['helpMessage'], + 'OptInKeywords' => + Serialize::map($options['optInKeywords'], function ($e) { return $e; }), + 'OptOutKeywords' => + Serialize::map($options['optOutKeywords'], function ($e) { return $e; }), + 'HelpKeywords' => + Serialize::map($options['helpKeywords'], function ($e) { return $e; }), + 'SubscriberOptIn' => + Serialize::booleanToString($options['subscriberOptIn']), + 'AgeGated' => + Serialize::booleanToString($options['ageGated']), + 'DirectLending' => + Serialize::booleanToString($options['directLending']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UsAppToPersonInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Reads UsAppToPersonInstance 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 UsAppToPersonInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UsAppToPersonInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsAppToPersonInstance 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 UsAppToPersonPage Page of UsAppToPersonInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsAppToPersonPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UsAppToPersonPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UsAppToPersonInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UsAppToPersonPage Page of UsAppToPersonInstance + */ + public function getPage(string $targetUrl): UsAppToPersonPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UsAppToPersonPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UsAppToPersonContext + * + * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. + */ + public function getContext( + string $sid + + ): UsAppToPersonContext + { + return new UsAppToPersonContext( + $this->version, + $this->solution['messagingServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php new file mode 100644 index 0000000..32e6f7d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php @@ -0,0 +1,228 @@ +options['optInMessage'] = $optInMessage; + $this->options['optOutMessage'] = $optOutMessage; + $this->options['helpMessage'] = $helpMessage; + $this->options['optInKeywords'] = $optInKeywords; + $this->options['optOutKeywords'] = $optOutKeywords; + $this->options['helpKeywords'] = $helpKeywords; + $this->options['subscriberOptIn'] = $subscriberOptIn; + $this->options['ageGated'] = $ageGated; + $this->options['directLending'] = $directLending; + } + + /** + * If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. + * + * @param string $optInMessage If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setOptInMessage(string $optInMessage): self + { + $this->options['optInMessage'] = $optInMessage; + return $this; + } + + /** + * Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * + * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setOptOutMessage(string $optOutMessage): self + { + $this->options['optOutMessage'] = $optOutMessage; + return $this; + } + + /** + * When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * + * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setHelpMessage(string $helpMessage): self + { + $this->options['helpMessage'] = $helpMessage; + return $this; + } + + /** + * If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. + * + * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setOptInKeywords(array $optInKeywords): self + { + $this->options['optInKeywords'] = $optInKeywords; + return $this; + } + + /** + * End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * + * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setOptOutKeywords(array $optOutKeywords): self + { + $this->options['optOutKeywords'] = $optOutKeywords; + return $this; + } + + /** + * End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * + * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setHelpKeywords(array $helpKeywords): self + { + $this->options['helpKeywords'] = $helpKeywords; + return $this; + } + + /** + * A boolean that specifies whether campaign has Subscriber Optin or not. + * + * @param bool $subscriberOptIn A boolean that specifies whether campaign has Subscriber Optin or not. + * @return $this Fluent Builder + */ + public function setSubscriberOptIn(bool $subscriberOptIn): self + { + $this->options['subscriberOptIn'] = $subscriberOptIn; + return $this; + } + + /** + * A boolean that specifies whether campaign is age gated or not. + * + * @param bool $ageGated A boolean that specifies whether campaign is age gated or not. + * @return $this Fluent Builder + */ + public function setAgeGated(bool $ageGated): self + { + $this->options['ageGated'] = $ageGated; + return $this; + } + + /** + * A boolean that specifies whether campaign allows direct lending or not. + * + * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. + * @return $this Fluent Builder + */ + public function setDirectLending(bool $directLending): self + { + $this->options['directLending'] = $directLending; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateUsAppToPersonOptions ' . $options . ']'; + } +} + + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php new file mode 100644 index 0000000..19194e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsAppToPersonInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonInstance + */ + public function buildInstance(array $payload): UsAppToPersonInstance + { + return new UsAppToPersonInstance($this->version, $payload, $this->solution['messagingServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php new file mode 100644 index 0000000..2fd8fee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'usAppToPersonUsecases' => Values::array_get($payload, 'us_app_to_person_usecases'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecaseInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php new file mode 100644 index 0000000..cdf2921 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php @@ -0,0 +1,88 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p/Usecases'; + } + + /** + * Fetch the UsAppToPersonUsecaseInstance + * + * @param array|Options $options Optional Arguments + * @return UsAppToPersonUsecaseInstance Fetched UsAppToPersonUsecaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsAppToPersonUsecaseInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'BrandRegistrationSid' => + $options['brandRegistrationSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new UsAppToPersonUsecaseInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecaseList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php new file mode 100644 index 0000000..67e9824 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php @@ -0,0 +1,76 @@ +options['brandRegistrationSid'] = $brandRegistrationSid; + } + + /** + * The unique string to identify the A2P brand. + * + * @param string $brandRegistrationSid The unique string to identify the A2P brand. + * @return $this Fluent Builder + */ + public function setBrandRegistrationSid(string $brandRegistrationSid): self + { + $this->options['brandRegistrationSid'] = $brandRegistrationSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.FetchUsAppToPersonUsecaseOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php new file mode 100644 index 0000000..83459bf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsAppToPersonUsecaseInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseInstance + */ + public function buildInstance(array $payload): UsAppToPersonUsecaseInstance + { + return new UsAppToPersonUsecaseInstance($this->version, $payload, $this->solution['messagingServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecasePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php new file mode 100644 index 0000000..d7ea84d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php @@ -0,0 +1,309 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + 'Usecase' => + $options['usecase'], + 'UseInboundWebhookOnNumber' => + Serialize::booleanToString($options['useInboundWebhookOnNumber']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the alphaSenders + */ + protected function getAlphaSenders(): AlphaSenderList + { + if (!$this->_alphaSenders) { + $this->_alphaSenders = new AlphaSenderList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_alphaSenders; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the usAppToPersonUsecases + */ + protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList + { + if (!$this->_usAppToPersonUsecases) { + $this->_usAppToPersonUsecases = new UsAppToPersonUsecaseList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usAppToPersonUsecases; + } + + /** + * Access the channelSenders + */ + protected function getChannelSenders(): ChannelSenderList + { + if (!$this->_channelSenders) { + $this->_channelSenders = new ChannelSenderList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channelSenders; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the usAppToPerson + */ + protected function getUsAppToPerson(): UsAppToPersonList + { + if (!$this->_usAppToPerson) { + $this->_usAppToPerson = new UsAppToPersonList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usAppToPerson; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php new file mode 100644 index 0000000..d879eb3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php @@ -0,0 +1,247 @@ +properties = [ + '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'), + 'usecase' => Values::array_get($payload, 'usecase'), + 'usAppToPersonRegistered' => Values::array_get($payload, 'us_app_to_person_registered'), + 'useInboundWebhookOnNumber' => Values::array_get($payload, 'use_inbound_webhook_on_number'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the alphaSenders + */ + protected function getAlphaSenders(): AlphaSenderList + { + return $this->proxy()->alphaSenders; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the usAppToPersonUsecases + */ + protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList + { + return $this->proxy()->usAppToPersonUsecases; + } + + /** + * Access the channelSenders + */ + protected function getChannelSenders(): ChannelSenderList + { + return $this->proxy()->channelSenders; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the usAppToPerson + */ + protected function getUsAppToPerson(): UsAppToPersonList + { + return $this->proxy()->usAppToPerson; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php new file mode 100644 index 0000000..6c23983 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php @@ -0,0 +1,222 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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']), + 'Usecase' => + $options['usecase'], + 'UseInboundWebhookOnNumber' => + Serialize::booleanToString($options['useInboundWebhookOnNumber']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php new file mode 100644 index 0000000..ca9c5e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php @@ -0,0 +1,652 @@ +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; + $this->options['usecase'] = $usecase; + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + } + + /** + * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setInboundRequestUrl(string $inboundRequestUrl): self + { + $this->options['inboundRequestUrl'] = $inboundRequestUrl; + return $this; + } + + /** + * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setInboundMethod(string $inboundMethod): self + { + $this->options['inboundMethod'] = $inboundMethod; + return $this; + } + + /** + * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + * + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + * @return $this Fluent Builder + */ + public function setStickySender(bool $stickySender): self + { + $this->options['stickySender'] = $stickySender; + return $this; + } + + /** + * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + * + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setMmsConverter(bool $mmsConverter): self + { + $this->options['mmsConverter'] = $mmsConverter; + return $this; + } + + /** + * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + * + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setSmartEncoding(bool $smartEncoding): self + { + $this->options['smartEncoding'] = $smartEncoding; + return $this; + } + + /** + * @param string $scanMessageContent + * @return $this Fluent Builder + */ + public function setScanMessageContent(string $scanMessageContent): self + { + $this->options['scanMessageContent'] = $scanMessageContent; + return $this; + } + + /** + * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + * + * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + * @return $this Fluent Builder + */ + public function setFallbackToLongCode(bool $fallbackToLongCode): self + { + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + return $this; + } + + /** + * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + * + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + * @return $this Fluent Builder + */ + public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self + { + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + return $this; + } + + /** + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved. + * + * @param bool $synchronousValidation Reserved. + * @return $this Fluent Builder + */ + public function setSynchronousValidation(bool $synchronousValidation): self + { + $this->options['synchronousValidation'] = $synchronousValidation; + return $this; + } + + /** + * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + * + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + * @return $this Fluent Builder + */ + public function setUsecase(string $usecase): self + { + $this->options['usecase'] = $usecase; + return $this; + } + + /** + * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self + { + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + * @param string $scanMessageContent + * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @param bool $synchronousValidation Reserved. + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $inboundRequestUrl = Values::NONE, + string $inboundMethod = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + bool $stickySender = Values::BOOL_NONE, + bool $mmsConverter = Values::BOOL_NONE, + bool $smartEncoding = Values::BOOL_NONE, + string $scanMessageContent = Values::NONE, + bool $fallbackToLongCode = Values::BOOL_NONE, + bool $areaCodeGeomatch = Values::BOOL_NONE, + int $validityPeriod = Values::INT_NONE, + bool $synchronousValidation = Values::BOOL_NONE, + string $usecase = Values::NONE, + bool $useInboundWebhookOnNumber = Values::BOOL_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; + $this->options['usecase'] = $usecase; + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setInboundRequestUrl(string $inboundRequestUrl): self + { + $this->options['inboundRequestUrl'] = $inboundRequestUrl; + return $this; + } + + /** + * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setInboundMethod(string $inboundMethod): self + { + $this->options['inboundMethod'] = $inboundMethod; + return $this; + } + + /** + * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + * + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. + * @return $this Fluent Builder + */ + public function setStickySender(bool $stickySender): self + { + $this->options['stickySender'] = $stickySender; + return $this; + } + + /** + * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + * + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setMmsConverter(bool $mmsConverter): self + { + $this->options['mmsConverter'] = $mmsConverter; + return $this; + } + + /** + * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + * + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setSmartEncoding(bool $smartEncoding): self + { + $this->options['smartEncoding'] = $smartEncoding; + return $this; + } + + /** + * @param string $scanMessageContent + * @return $this Fluent Builder + */ + public function setScanMessageContent(string $scanMessageContent): self + { + $this->options['scanMessageContent'] = $scanMessageContent; + return $this; + } + + /** + * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + * + * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. + * @return $this Fluent Builder + */ + public function setFallbackToLongCode(bool $fallbackToLongCode): self + { + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + return $this; + } + + /** + * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + * + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. + * @return $this Fluent Builder + */ + public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self + { + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + return $this; + } + + /** + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved. + * + * @param bool $synchronousValidation Reserved. + * @return $this Fluent Builder + */ + public function setSynchronousValidation(bool $synchronousValidation): self + { + $this->options['synchronousValidation'] = $synchronousValidation; + return $this; + } + + /** + * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + * + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. + * @return $this Fluent Builder + */ + public function setUsecase(string $usecase): self + { + $this->options['usecase'] = $usecase; + return $this; + } + + /** + * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self + { + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php new file mode 100644 index 0000000..4a15a87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Messaging\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php new file mode 100644 index 0000000..df610ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php @@ -0,0 +1,167 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Tollfree/Verifications/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TollfreeVerificationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TollfreeVerificationInstance + * + * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TollfreeVerificationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TollfreeVerificationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TollfreeVerificationInstance + * + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TollfreeVerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BusinessName' => + $options['businessName'], + 'BusinessWebsite' => + $options['businessWebsite'], + 'NotificationEmail' => + $options['notificationEmail'], + 'UseCaseCategories' => + Serialize::map($options['useCaseCategories'], function ($e) { return $e; }), + 'UseCaseSummary' => + $options['useCaseSummary'], + 'ProductionMessageSample' => + $options['productionMessageSample'], + 'OptInImageUrls' => + Serialize::map($options['optInImageUrls'], function ($e) { return $e; }), + 'OptInType' => + $options['optInType'], + 'MessageVolume' => + $options['messageVolume'], + 'BusinessStreetAddress' => + $options['businessStreetAddress'], + 'BusinessStreetAddress2' => + $options['businessStreetAddress2'], + 'BusinessCity' => + $options['businessCity'], + 'BusinessStateProvinceRegion' => + $options['businessStateProvinceRegion'], + 'BusinessPostalCode' => + $options['businessPostalCode'], + 'BusinessCountry' => + $options['businessCountry'], + 'AdditionalInformation' => + $options['additionalInformation'], + 'BusinessContactFirstName' => + $options['businessContactFirstName'], + 'BusinessContactLastName' => + $options['businessContactLastName'], + 'BusinessContactEmail' => + $options['businessContactEmail'], + 'BusinessContactPhone' => + $options['businessContactPhone'], + 'EditReason' => + $options['editReason'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TollfreeVerificationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.TollfreeVerificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php new file mode 100644 index 0000000..50344d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php @@ -0,0 +1,214 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'regulatedItemSid' => Values::array_get($payload, 'regulated_item_sid'), + 'businessName' => Values::array_get($payload, 'business_name'), + 'businessStreetAddress' => Values::array_get($payload, 'business_street_address'), + 'businessStreetAddress2' => Values::array_get($payload, 'business_street_address2'), + 'businessCity' => Values::array_get($payload, 'business_city'), + 'businessStateProvinceRegion' => Values::array_get($payload, 'business_state_province_region'), + 'businessPostalCode' => Values::array_get($payload, 'business_postal_code'), + 'businessCountry' => Values::array_get($payload, 'business_country'), + 'businessWebsite' => Values::array_get($payload, 'business_website'), + 'businessContactFirstName' => Values::array_get($payload, 'business_contact_first_name'), + 'businessContactLastName' => Values::array_get($payload, 'business_contact_last_name'), + 'businessContactEmail' => Values::array_get($payload, 'business_contact_email'), + 'businessContactPhone' => Values::array_get($payload, 'business_contact_phone'), + 'notificationEmail' => Values::array_get($payload, 'notification_email'), + 'useCaseCategories' => Values::array_get($payload, 'use_case_categories'), + 'useCaseSummary' => Values::array_get($payload, 'use_case_summary'), + 'productionMessageSample' => Values::array_get($payload, 'production_message_sample'), + 'optInImageUrls' => Values::array_get($payload, 'opt_in_image_urls'), + 'optInType' => Values::array_get($payload, 'opt_in_type'), + 'messageVolume' => Values::array_get($payload, 'message_volume'), + 'additionalInformation' => Values::array_get($payload, 'additional_information'), + 'tollfreePhoneNumberSid' => Values::array_get($payload, 'tollfree_phone_number_sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'editExpiration' => Deserialize::dateTime(Values::array_get($payload, 'edit_expiration')), + 'editAllowed' => Values::array_get($payload, 'edit_allowed'), + 'rejectionReasons' => Values::array_get($payload, 'rejection_reasons'), + 'resourceLinks' => Values::array_get($payload, 'resource_links'), + 'externalReferenceId' => Values::array_get($payload, 'external_reference_id'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TollfreeVerificationContext Context for this TollfreeVerificationInstance + */ + protected function proxy(): TollfreeVerificationContext + { + if (!$this->context) { + $this->context = new TollfreeVerificationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TollfreeVerificationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TollfreeVerificationInstance + * + * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TollfreeVerificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TollfreeVerificationInstance + * + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TollfreeVerificationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.TollfreeVerificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php new file mode 100644 index 0000000..b8a84fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php @@ -0,0 +1,257 @@ +solution = [ + ]; + + $this->uri = '/Tollfree/Verifications'; + } + + /** + * Create the TollfreeVerificationInstance + * + * @param string $businessName The name of the business or organization using the Tollfree number. + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @param string $optInType + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Created TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $businessName, string $businessWebsite, string $notificationEmail, array $useCaseCategories, string $useCaseSummary, string $productionMessageSample, array $optInImageUrls, string $optInType, string $messageVolume, string $tollfreePhoneNumberSid, array $options = []): TollfreeVerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BusinessName' => + $businessName, + 'BusinessWebsite' => + $businessWebsite, + 'NotificationEmail' => + $notificationEmail, + 'UseCaseCategories' => + Serialize::map($useCaseCategories,function ($e) { return $e; }), + 'UseCaseSummary' => + $useCaseSummary, + 'ProductionMessageSample' => + $productionMessageSample, + 'OptInImageUrls' => + Serialize::map($optInImageUrls,function ($e) { return $e; }), + 'OptInType' => + $optInType, + 'MessageVolume' => + $messageVolume, + 'TollfreePhoneNumberSid' => + $tollfreePhoneNumberSid, + 'CustomerProfileSid' => + $options['customerProfileSid'], + 'BusinessStreetAddress' => + $options['businessStreetAddress'], + 'BusinessStreetAddress2' => + $options['businessStreetAddress2'], + 'BusinessCity' => + $options['businessCity'], + 'BusinessStateProvinceRegion' => + $options['businessStateProvinceRegion'], + 'BusinessPostalCode' => + $options['businessPostalCode'], + 'BusinessCountry' => + $options['businessCountry'], + 'AdditionalInformation' => + $options['additionalInformation'], + 'BusinessContactFirstName' => + $options['businessContactFirstName'], + 'BusinessContactLastName' => + $options['businessContactLastName'], + 'BusinessContactEmail' => + $options['businessContactEmail'], + 'BusinessContactPhone' => + $options['businessContactPhone'], + 'ExternalReferenceId' => + $options['externalReferenceId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TollfreeVerificationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TollfreeVerificationInstance 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 TollfreeVerificationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TollfreeVerificationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollfreeVerificationInstance 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 TollfreeVerificationPage Page of TollfreeVerificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollfreeVerificationPage + { + $options = new Values($options); + + $params = Values::of([ + 'TollfreePhoneNumberSid' => + $options['tollfreePhoneNumberSid'], + 'Status' => + $options['status'], + 'ExternalReferenceId' => + $options['externalReferenceId'], + 'IncludeSubAccounts' => + Serialize::booleanToString($options['includeSubAccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TollfreeVerificationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TollfreeVerificationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TollfreeVerificationPage Page of TollfreeVerificationInstance + */ + public function getPage(string $targetUrl): TollfreeVerificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TollfreeVerificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TollfreeVerificationContext + * + * @param string $sid The unique string to identify Tollfree Verification. + */ + public function getContext( + string $sid + + ): TollfreeVerificationContext + { + return new TollfreeVerificationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.TollfreeVerificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php new file mode 100644 index 0000000..2a0154d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php @@ -0,0 +1,812 @@ +options['customerProfileSid'] = $customerProfileSid; + $this->options['businessStreetAddress'] = $businessStreetAddress; + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + $this->options['businessCity'] = $businessCity; + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + $this->options['businessPostalCode'] = $businessPostalCode; + $this->options['businessCountry'] = $businessCountry; + $this->options['additionalInformation'] = $additionalInformation; + $this->options['businessContactFirstName'] = $businessContactFirstName; + $this->options['businessContactLastName'] = $businessContactLastName; + $this->options['businessContactEmail'] = $businessContactEmail; + $this->options['businessContactPhone'] = $businessContactPhone; + $this->options['externalReferenceId'] = $externalReferenceId; + } + + /** + * Customer's Profile Bundle BundleSid. + * + * @param string $customerProfileSid Customer's Profile Bundle BundleSid. + * @return $this Fluent Builder + */ + public function setCustomerProfileSid(string $customerProfileSid): self + { + $this->options['customerProfileSid'] = $customerProfileSid; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress(string $businessStreetAddress): self + { + $this->options['businessStreetAddress'] = $businessStreetAddress; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress2(string $businessStreetAddress2): self + { + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + return $this; + } + + /** + * The city of the business or organization using the Tollfree number. + * + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCity(string $businessCity): self + { + $this->options['businessCity'] = $businessCity; + return $this; + } + + /** + * The state/province/region of the business or organization using the Tollfree number. + * + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self + { + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + return $this; + } + + /** + * The postal code of the business or organization using the Tollfree number. + * + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessPostalCode(string $businessPostalCode): self + { + $this->options['businessPostalCode'] = $businessPostalCode; + return $this; + } + + /** + * The country of the business or organization using the Tollfree number. + * + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCountry(string $businessCountry): self + { + $this->options['businessCountry'] = $businessCountry; + return $this; + } + + /** + * Additional information to be provided for verification. + * + * @param string $additionalInformation Additional information to be provided for verification. + * @return $this Fluent Builder + */ + public function setAdditionalInformation(string $additionalInformation): self + { + $this->options['additionalInformation'] = $additionalInformation; + return $this; + } + + /** + * The first name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactFirstName(string $businessContactFirstName): self + { + $this->options['businessContactFirstName'] = $businessContactFirstName; + return $this; + } + + /** + * The last name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactLastName(string $businessContactLastName): self + { + $this->options['businessContactLastName'] = $businessContactLastName; + return $this; + } + + /** + * The email address of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactEmail(string $businessContactEmail): self + { + $this->options['businessContactEmail'] = $businessContactEmail; + return $this; + } + + /** + * The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactPhone(string $businessContactPhone): self + { + $this->options['businessContactPhone'] = $businessContactPhone; + return $this; + } + + /** + * An optional external reference ID supplied by customer and echoed back on status retrieval. + * + * @param string $externalReferenceId An optional external reference ID supplied by customer and echoed back on status retrieval. + * @return $this Fluent Builder + */ + public function setExternalReferenceId(string $externalReferenceId): self + { + $this->options['externalReferenceId'] = $externalReferenceId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateTollfreeVerificationOptions ' . $options . ']'; + } +} + + + +class ReadTollfreeVerificationOptions extends Options + { + /** + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @param string $status The compliance status of the Tollfree Verification record. + * @param string $externalReferenceId Customer supplied reference id for the Tollfree Verification record. + * @param bool $includeSubAccounts Whether to include Tollfree Verifications from sub accounts in list response. + */ + public function __construct( + + string $tollfreePhoneNumberSid = Values::NONE, + string $status = Values::NONE, + string $externalReferenceId = Values::NONE, + bool $includeSubAccounts = Values::BOOL_NONE + + ) { + $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; + $this->options['status'] = $status; + $this->options['externalReferenceId'] = $externalReferenceId; + $this->options['includeSubAccounts'] = $includeSubAccounts; + } + + /** + * The SID of the Phone Number associated with the Tollfree Verification. + * + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @return $this Fluent Builder + */ + public function setTollfreePhoneNumberSid(string $tollfreePhoneNumberSid): self + { + $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; + return $this; + } + + /** + * The compliance status of the Tollfree Verification record. + * + * @param string $status The compliance status of the Tollfree Verification record. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Customer supplied reference id for the Tollfree Verification record. + * + * @param string $externalReferenceId Customer supplied reference id for the Tollfree Verification record. + * @return $this Fluent Builder + */ + public function setExternalReferenceId(string $externalReferenceId): self + { + $this->options['externalReferenceId'] = $externalReferenceId; + return $this; + } + + /** + * Whether to include Tollfree Verifications from sub accounts in list response. + * + * @param bool $includeSubAccounts Whether to include Tollfree Verifications from sub accounts in list response. + * @return $this Fluent Builder + */ + public function setIncludeSubAccounts(bool $includeSubAccounts): self + { + $this->options['includeSubAccounts'] = $includeSubAccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.ReadTollfreeVerificationOptions ' . $options . ']'; + } +} + +class UpdateTollfreeVerificationOptions extends Options + { + /** + * @param string $businessName The name of the business or organization using the Tollfree number. + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @param string $optInType + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @param string $additionalInformation Additional information to be provided for verification. + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. + * @param string $editReason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. + */ + public function __construct( + + string $businessName = Values::NONE, + string $businessWebsite = Values::NONE, + string $notificationEmail = Values::NONE, + array $useCaseCategories = Values::ARRAY_NONE, + string $useCaseSummary = Values::NONE, + string $productionMessageSample = Values::NONE, + array $optInImageUrls = Values::ARRAY_NONE, + string $optInType = Values::NONE, + string $messageVolume = Values::NONE, + string $businessStreetAddress = Values::NONE, + string $businessStreetAddress2 = Values::NONE, + string $businessCity = Values::NONE, + string $businessStateProvinceRegion = Values::NONE, + string $businessPostalCode = Values::NONE, + string $businessCountry = Values::NONE, + string $additionalInformation = Values::NONE, + string $businessContactFirstName = Values::NONE, + string $businessContactLastName = Values::NONE, + string $businessContactEmail = Values::NONE, + string $businessContactPhone = Values::NONE, + string $editReason = Values::NONE + + ) { + $this->options['businessName'] = $businessName; + $this->options['businessWebsite'] = $businessWebsite; + $this->options['notificationEmail'] = $notificationEmail; + $this->options['useCaseCategories'] = $useCaseCategories; + $this->options['useCaseSummary'] = $useCaseSummary; + $this->options['productionMessageSample'] = $productionMessageSample; + $this->options['optInImageUrls'] = $optInImageUrls; + $this->options['optInType'] = $optInType; + $this->options['messageVolume'] = $messageVolume; + $this->options['businessStreetAddress'] = $businessStreetAddress; + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + $this->options['businessCity'] = $businessCity; + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + $this->options['businessPostalCode'] = $businessPostalCode; + $this->options['businessCountry'] = $businessCountry; + $this->options['additionalInformation'] = $additionalInformation; + $this->options['businessContactFirstName'] = $businessContactFirstName; + $this->options['businessContactLastName'] = $businessContactLastName; + $this->options['businessContactEmail'] = $businessContactEmail; + $this->options['businessContactPhone'] = $businessContactPhone; + $this->options['editReason'] = $editReason; + } + + /** + * The name of the business or organization using the Tollfree number. + * + * @param string $businessName The name of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessName(string $businessName): self + { + $this->options['businessName'] = $businessName; + return $this; + } + + /** + * The website of the business or organization using the Tollfree number. + * + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessWebsite(string $businessWebsite): self + { + $this->options['businessWebsite'] = $businessWebsite; + return $this; + } + + /** + * The email address to receive the notification about the verification result. . + * + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @return $this Fluent Builder + */ + public function setNotificationEmail(string $notificationEmail): self + { + $this->options['notificationEmail'] = $notificationEmail; + return $this; + } + + /** + * The category of the use case for the Tollfree Number. List as many are applicable.. + * + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @return $this Fluent Builder + */ + public function setUseCaseCategories(array $useCaseCategories): self + { + $this->options['useCaseCategories'] = $useCaseCategories; + return $this; + } + + /** + * Use this to further explain how messaging is used by the business or organization. + * + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @return $this Fluent Builder + */ + public function setUseCaseSummary(string $useCaseSummary): self + { + $this->options['useCaseSummary'] = $useCaseSummary; + return $this; + } + + /** + * An example of message content, i.e. a sample message. + * + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @return $this Fluent Builder + */ + public function setProductionMessageSample(string $productionMessageSample): self + { + $this->options['productionMessageSample'] = $productionMessageSample; + return $this; + } + + /** + * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @return $this Fluent Builder + */ + public function setOptInImageUrls(array $optInImageUrls): self + { + $this->options['optInImageUrls'] = $optInImageUrls; + return $this; + } + + /** + * @param string $optInType + * @return $this Fluent Builder + */ + public function setOptInType(string $optInType): self + { + $this->options['optInType'] = $optInType; + return $this; + } + + /** + * Estimate monthly volume of messages from the Tollfree Number. + * + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @return $this Fluent Builder + */ + public function setMessageVolume(string $messageVolume): self + { + $this->options['messageVolume'] = $messageVolume; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress(string $businessStreetAddress): self + { + $this->options['businessStreetAddress'] = $businessStreetAddress; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress2(string $businessStreetAddress2): self + { + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + return $this; + } + + /** + * The city of the business or organization using the Tollfree number. + * + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCity(string $businessCity): self + { + $this->options['businessCity'] = $businessCity; + return $this; + } + + /** + * The state/province/region of the business or organization using the Tollfree number. + * + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self + { + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + return $this; + } + + /** + * The postal code of the business or organization using the Tollfree number. + * + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessPostalCode(string $businessPostalCode): self + { + $this->options['businessPostalCode'] = $businessPostalCode; + return $this; + } + + /** + * The country of the business or organization using the Tollfree number. + * + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCountry(string $businessCountry): self + { + $this->options['businessCountry'] = $businessCountry; + return $this; + } + + /** + * Additional information to be provided for verification. + * + * @param string $additionalInformation Additional information to be provided for verification. + * @return $this Fluent Builder + */ + public function setAdditionalInformation(string $additionalInformation): self + { + $this->options['additionalInformation'] = $additionalInformation; + return $this; + } + + /** + * The first name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactFirstName(string $businessContactFirstName): self + { + $this->options['businessContactFirstName'] = $businessContactFirstName; + return $this; + } + + /** + * The last name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactLastName(string $businessContactLastName): self + { + $this->options['businessContactLastName'] = $businessContactLastName; + return $this; + } + + /** + * The email address of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactEmail(string $businessContactEmail): self + { + $this->options['businessContactEmail'] = $businessContactEmail; + return $this; + } + + /** + * The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactPhone(string $businessContactPhone): self + { + $this->options['businessContactPhone'] = $businessContactPhone; + return $this; + } + + /** + * Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. + * + * @param string $editReason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. + * @return $this Fluent Builder + */ + public function setEditReason(string $editReason): self + { + $this->options['editReason'] = $editReason; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateTollfreeVerificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php new file mode 100644 index 0000000..7b4a387 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollfreeVerificationInstance \Twilio\Rest\Messaging\V1\TollfreeVerificationInstance + */ + public function buildInstance(array $payload): TollfreeVerificationInstance + { + return new TollfreeVerificationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.TollfreeVerificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseInstance.php new file mode 100644 index 0000000..aacd5ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'usecases' => Values::array_get($payload, 'usecases'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecaseInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseList.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseList.php new file mode 100644 index 0000000..8279236 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecaseList.php @@ -0,0 +1,72 @@ +solution = [ + ]; + + $this->uri = '/Services/Usecases'; + } + + /** + * Fetch the UsecaseInstance + * + * @return UsecaseInstance Fetched UsecaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsecaseInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new UsecaseInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecaseList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecasePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecasePage.php new file mode 100644 index 0000000..b5f6d40 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Messaging/V1/UsecasePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsecaseInstance \Twilio\Rest\Messaging\V1\UsecaseInstance + */ + public function buildInstance(array $payload): UsecaseInstance + { + return new UsecaseInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecasePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/MessagingBase.php b/vendor/twilio/sdk/src/Twilio/Rest/MessagingBase.php new file mode 100644 index 0000000..8cde367 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/MessagingBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://messaging.twilio.com'; + } + + + /** + * @return V1 Version v1 of messaging + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Messaging]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor.php new file mode 100644 index 0000000..ca754c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor.php @@ -0,0 +1,42 @@ +apps instead. + */ + protected function getApps(): \Twilio\Rest\Microvisor\V1\AppList { + echo "apps is deprecated. Use v1->apps instead."; + return $this->v1->apps; + } + + /** + * @deprecated Use v1->apps(\$sid) instead. + * @param string $sid A string that uniquely identifies this App. + */ + protected function contextApps(string $sid): \Twilio\Rest\Microvisor\V1\AppContext { + echo "apps(\$sid) is deprecated. Use v1->apps(\$sid) instead."; + return $this->v1->apps($sid); + } + + /** + * @deprecated Use v1->devices instead. + */ + protected function getDevices(): \Twilio\Rest\Microvisor\V1\DeviceList { + echo "devices is deprecated. Use v1->devices instead."; + return $this->v1->devices; + } + + /** + * @deprecated Use v1->devices(\$sid) instead. + * @param string $sid A string that uniquely identifies this Device. + */ + protected function contextDevices(string $sid): \Twilio\Rest\Microvisor\V1\DeviceContext { + echo "devices(\$sid) is deprecated. Use v1->devices(\$sid) instead."; + return $this->v1->devices($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1.php new file mode 100644 index 0000000..092b685 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1.php @@ -0,0 +1,131 @@ +version = 'v1'; + } + + protected function getAccountConfigs(): AccountConfigList + { + if (!$this->_accountConfigs) { + $this->_accountConfigs = new AccountConfigList($this); + } + return $this->_accountConfigs; + } + + protected function getAccountSecrets(): AccountSecretList + { + if (!$this->_accountSecrets) { + $this->_accountSecrets = new AccountSecretList($this); + } + return $this->_accountSecrets; + } + + protected function getApps(): AppList + { + if (!$this->_apps) { + $this->_apps = new AppList($this); + } + return $this->_apps; + } + + protected function getDevices(): DeviceList + { + if (!$this->_devices) { + $this->_devices = new DeviceList($this); + } + return $this->_devices; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Microvisor.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php new file mode 100644 index 0000000..72fecca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php @@ -0,0 +1,123 @@ +solution = [ + 'key' => + $key, + ]; + + $this->uri = '/Configs/' . \rawurlencode($key) + .''; + } + + /** + * Delete the AccountConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AccountConfigInstance + * + * @return AccountConfigInstance Fetched AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountConfigInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AccountConfigInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Update the AccountConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Updated AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountConfigInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AccountConfigInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php new file mode 100644 index 0000000..14889e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'value' => Values::array_get($payload, 'value'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 AccountConfigContext Context for this AccountConfigInstance + */ + protected function proxy(): AccountConfigContext + { + if (!$this->context) { + $this->context = new AccountConfigContext( + $this->version, + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the AccountConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AccountConfigInstance + * + * @return AccountConfigInstance Fetched AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Updated AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountConfigInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigList.php new file mode 100644 index 0000000..977d82a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigList.php @@ -0,0 +1,190 @@ +solution = [ + ]; + + $this->uri = '/Configs'; + } + + /** + * Create the AccountConfigInstance + * + * @param string $key The config key; up to 100 characters. + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Created AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): AccountConfigInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AccountConfigInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AccountConfigInstance 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 AccountConfigInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AccountConfigInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountConfigInstance 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 AccountConfigPage Page of AccountConfigInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountConfigPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AccountConfigPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AccountConfigInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AccountConfigPage Page of AccountConfigInstance + */ + public function getPage(string $targetUrl): AccountConfigPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountConfigPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountConfigContext + * + * @param string $key The config key; up to 100 characters. + */ + public function getContext( + string $key + + ): AccountConfigContext + { + return new AccountConfigContext( + $this->version, + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountConfigList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigPage.php new file mode 100644 index 0000000..8f757e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountConfigInstance \Twilio\Rest\Microvisor\V1\AccountConfigInstance + */ + public function buildInstance(array $payload): AccountConfigInstance + { + return new AccountConfigInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountConfigPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php new file mode 100644 index 0000000..7e40de9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php @@ -0,0 +1,123 @@ +solution = [ + 'key' => + $key, + ]; + + $this->uri = '/Secrets/' . \rawurlencode($key) + .''; + } + + /** + * Delete the AccountSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AccountSecretInstance + * + * @return AccountSecretInstance Fetched AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountSecretInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AccountSecretInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Update the AccountSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Updated AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountSecretInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AccountSecretInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountSecretContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php new file mode 100644 index 0000000..4bfe6bc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 AccountSecretContext Context for this AccountSecretInstance + */ + protected function proxy(): AccountSecretContext + { + if (!$this->context) { + $this->context = new AccountSecretContext( + $this->version, + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the AccountSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AccountSecretInstance + * + * @return AccountSecretInstance Fetched AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountSecretInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Updated AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountSecretInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountSecretInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretList.php new file mode 100644 index 0000000..3453e37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretList.php @@ -0,0 +1,190 @@ +solution = [ + ]; + + $this->uri = '/Secrets'; + } + + /** + * Create the AccountSecretInstance + * + * @param string $key The secret key; up to 100 characters. + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Created AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): AccountSecretInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AccountSecretInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AccountSecretInstance 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 AccountSecretInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AccountSecretInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountSecretInstance 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 AccountSecretPage Page of AccountSecretInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountSecretPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AccountSecretPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AccountSecretInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AccountSecretPage Page of AccountSecretInstance + */ + public function getPage(string $targetUrl): AccountSecretPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountSecretPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountSecretContext + * + * @param string $key The secret key; up to 100 characters. + */ + public function getContext( + string $key + + ): AccountSecretContext + { + return new AccountSecretContext( + $this->version, + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountSecretList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretPage.php new file mode 100644 index 0000000..049ba25 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountSecretInstance \Twilio\Rest\Microvisor\V1\AccountSecretInstance + */ + public function buildInstance(array $payload): AccountSecretInstance + { + return new AccountSecretInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountSecretPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php new file mode 100644 index 0000000..9fa9a01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php @@ -0,0 +1,83 @@ +solution = [ + 'appSid' => + $appSid, + ]; + + $this->uri = '/Apps/' . \rawurlencode($appSid) + .'/Manifest'; + } + + /** + * Fetch the AppManifestInstance + * + * @return AppManifestInstance Fetched AppManifestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppManifestInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AppManifestInstance( + $this->version, + $payload, + $this->solution['appSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppManifestContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php new file mode 100644 index 0000000..504c5ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'appSid' => Values::array_get($payload, 'app_sid'), + 'hash' => Values::array_get($payload, 'hash'), + 'encodedBytes' => Values::array_get($payload, 'encoded_bytes'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['appSid' => $appSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AppManifestContext Context for this AppManifestInstance + */ + protected function proxy(): AppManifestContext + { + if (!$this->context) { + $this->context = new AppManifestContext( + $this->version, + $this->solution['appSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AppManifestInstance + * + * @return AppManifestInstance Fetched AppManifestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppManifestInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppManifestInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestList.php new file mode 100644 index 0000000..92e817f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestList.php @@ -0,0 +1,67 @@ +solution = [ + 'appSid' => + $appSid, + + ]; + } + + /** + * Constructs a AppManifestContext + */ + public function getContext( + + ): AppManifestContext + { + return new AppManifestContext( + $this->version, + $this->solution['appSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppManifestList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php new file mode 100644 index 0000000..a0641e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AppManifestInstance \Twilio\Rest\Microvisor\V1\App\AppManifestInstance + */ + public function buildInstance(array $payload): AppManifestInstance + { + return new AppManifestInstance($this->version, $payload, $this->solution['appSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppManifestPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppContext.php new file mode 100644 index 0000000..232149d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppContext.php @@ -0,0 +1,155 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Apps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AppInstance + * + * @return AppInstance Fetched AppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AppInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the appManifests + */ + protected function getAppManifests(): AppManifestList + { + if (!$this->_appManifests) { + $this->_appManifests = new AppManifestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_appManifests; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppInstance.php new file mode 100644 index 0000000..890f7ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'hash' => Values::array_get($payload, 'hash'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AppContext Context for this AppInstance + */ + protected function proxy(): AppContext + { + if (!$this->context) { + $this->context = new AppContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AppInstance + * + * @return AppInstance Fetched AppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the appManifests + */ + protected function getAppManifests(): AppManifestList + { + return $this->proxy()->appManifests; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppList.php new file mode 100644 index 0000000..2c97122 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Apps'; + } + + /** + * Reads AppInstance 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 AppInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AppInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AppInstance 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 AppPage Page of AppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AppPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AppPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AppInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AppPage Page of AppInstance + */ + public function getPage(string $targetUrl): AppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AppContext + * + * @param string $sid A 34-character string that uniquely identifies this App. + */ + public function getContext( + string $sid + + ): AppContext + { + return new AppContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppPage.php new file mode 100644 index 0000000..18f4a28 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/AppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AppInstance \Twilio\Rest\Microvisor\V1\AppInstance + */ + public function buildInstance(array $payload): AppInstance + { + return new AppInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php new file mode 100644 index 0000000..65eda56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php @@ -0,0 +1,130 @@ +solution = [ + 'deviceSid' => + $deviceSid, + 'key' => + $key, + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Configs/' . \rawurlencode($key) + .''; + } + + /** + * Delete the DeviceConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DeviceConfigInstance + * + * @return DeviceConfigInstance Fetched DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceConfigInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Update the DeviceConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Updated DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceConfigInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php new file mode 100644 index 0000000..1d28890 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'key' => Values::array_get($payload, 'key'), + 'value' => Values::array_get($payload, 'value'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['deviceSid' => $deviceSid, '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 DeviceConfigContext Context for this DeviceConfigInstance + */ + protected function proxy(): DeviceConfigContext + { + if (!$this->context) { + $this->context = new DeviceConfigContext( + $this->version, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceConfigInstance + * + * @return DeviceConfigInstance Fetched DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Updated DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceConfigInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php new file mode 100644 index 0000000..c6a13b2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php @@ -0,0 +1,198 @@ +solution = [ + 'deviceSid' => + $deviceSid, + + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Configs'; + } + + /** + * Create the DeviceConfigInstance + * + * @param string $key The config key; up to 100 characters. + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Created DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): DeviceConfigInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'] + ); + } + + + /** + * Reads DeviceConfigInstance 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 DeviceConfigInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeviceConfigInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceConfigInstance 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 DeviceConfigPage Page of DeviceConfigInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeviceConfigPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeviceConfigPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceConfigInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeviceConfigPage Page of DeviceConfigInstance + */ + public function getPage(string $targetUrl): DeviceConfigPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeviceConfigPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceConfigContext + * + * @param string $key The config key; up to 100 characters. + */ + public function getContext( + string $key + + ): DeviceConfigContext + { + return new DeviceConfigContext( + $this->version, + $this->solution['deviceSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceConfigList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php new file mode 100644 index 0000000..9de396a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceConfigInstance \Twilio\Rest\Microvisor\V1\Device\DeviceConfigInstance + */ + public function buildInstance(array $payload): DeviceConfigInstance + { + return new DeviceConfigInstance($this->version, $payload, $this->solution['deviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceConfigPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php new file mode 100644 index 0000000..baa3ceb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php @@ -0,0 +1,130 @@ +solution = [ + 'deviceSid' => + $deviceSid, + 'key' => + $key, + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Secrets/' . \rawurlencode($key) + .''; + } + + /** + * Delete the DeviceSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DeviceSecretInstance + * + * @return DeviceSecretInstance Fetched DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceSecretInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Update the DeviceSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Updated DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceSecretInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceSecretContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php new file mode 100644 index 0000000..88938bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'key' => Values::array_get($payload, 'key'), + 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['deviceSid' => $deviceSid, '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 DeviceSecretContext Context for this DeviceSecretInstance + */ + protected function proxy(): DeviceSecretContext + { + if (!$this->context) { + $this->context = new DeviceSecretContext( + $this->version, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceSecretInstance + * + * @return DeviceSecretInstance Fetched DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceSecretInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Updated DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceSecretInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceSecretInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php new file mode 100644 index 0000000..2c34848 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php @@ -0,0 +1,198 @@ +solution = [ + 'deviceSid' => + $deviceSid, + + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Secrets'; + } + + /** + * Create the DeviceSecretInstance + * + * @param string $key The secret key; up to 100 characters. + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Created DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): DeviceSecretInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'] + ); + } + + + /** + * Reads DeviceSecretInstance 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 DeviceSecretInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeviceSecretInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceSecretInstance 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 DeviceSecretPage Page of DeviceSecretInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeviceSecretPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeviceSecretPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceSecretInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeviceSecretPage Page of DeviceSecretInstance + */ + public function getPage(string $targetUrl): DeviceSecretPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeviceSecretPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceSecretContext + * + * @param string $key The secret key; up to 100 characters. + */ + public function getContext( + string $key + + ): DeviceSecretContext + { + return new DeviceSecretContext( + $this->version, + $this->solution['deviceSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceSecretList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php new file mode 100644 index 0000000..441965e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceSecretInstance \Twilio\Rest\Microvisor\V1\Device\DeviceSecretInstance + */ + public function buildInstance(array $payload): DeviceSecretInstance + { + return new DeviceSecretInstance($this->version, $payload, $this->solution['deviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceSecretPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceContext.php new file mode 100644 index 0000000..54c47ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceContext.php @@ -0,0 +1,196 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Devices/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'TargetApp' => + $options['targetApp'], + 'LoggingEnabled' => + Serialize::booleanToString($options['loggingEnabled']), + 'RestartApp' => + Serialize::booleanToString($options['restartApp']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the deviceConfigs + */ + protected function getDeviceConfigs(): DeviceConfigList + { + if (!$this->_deviceConfigs) { + $this->_deviceConfigs = new DeviceConfigList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deviceConfigs; + } + + /** + * Access the deviceSecrets + */ + protected function getDeviceSecrets(): DeviceSecretList + { + if (!$this->_deviceSecrets) { + $this->_deviceSecrets = new DeviceSecretList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deviceSecrets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceInstance.php new file mode 100644 index 0000000..2a8e4ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'app' => Values::array_get($payload, 'app'), + 'logging' => Values::array_get($payload, 'logging'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeviceContext Context for this DeviceInstance + */ + protected function proxy(): DeviceContext + { + if (!$this->context) { + $this->context = new DeviceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deviceConfigs + */ + protected function getDeviceConfigs(): DeviceConfigList + { + return $this->proxy()->deviceConfigs; + } + + /** + * Access the deviceSecrets + */ + protected function getDeviceSecrets(): DeviceSecretList + { + return $this->proxy()->deviceSecrets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceList.php new file mode 100644 index 0000000..43c804e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Devices'; + } + + /** + * 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 int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceInstance 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 DevicePage Page of DeviceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DevicePage + { + + $params = Values::of([ + '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 DevicePage Page of DeviceInstance + */ + public function getPage(string $targetUrl): DevicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DevicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceContext + * + * @param string $sid A 34-character string that uniquely identifies this Device. + */ + public function getContext( + string $sid + + ): DeviceContext + { + return new DeviceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceOptions.php new file mode 100644 index 0000000..4fee9ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DeviceOptions.php @@ -0,0 +1,134 @@ +options['uniqueName'] = $uniqueName; + $this->options['targetApp'] = $targetApp; + $this->options['loggingEnabled'] = $loggingEnabled; + $this->options['restartApp'] = $restartApp; + } + + /** + * A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. + * + * @param string $uniqueName A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The SID or unique name of the App to be targeted to the Device. + * + * @param string $targetApp The SID or unique name of the App to be targeted to the Device. + * @return $this Fluent Builder + */ + public function setTargetApp(string $targetApp): self + { + $this->options['targetApp'] = $targetApp; + return $this; + } + + /** + * A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. + * + * @param bool $loggingEnabled A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. + * @return $this Fluent Builder + */ + public function setLoggingEnabled(bool $loggingEnabled): self + { + $this->options['loggingEnabled'] = $loggingEnabled; + return $this; + } + + /** + * Set to true to restart the App running on the Device. + * + * @param bool $restartApp Set to true to restart the App running on the Device. + * @return $this Fluent Builder + */ + public function setRestartApp(bool $restartApp): self + { + $this->options['restartApp'] = $restartApp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Microvisor.V1.UpdateDeviceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DevicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DevicePage.php new file mode 100644 index 0000000..7355e90 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Microvisor/V1/DevicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceInstance \Twilio\Rest\Microvisor\V1\DeviceInstance + */ + public function buildInstance(array $payload): DeviceInstance + { + return new DeviceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DevicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/MicrovisorBase.php b/vendor/twilio/sdk/src/Twilio/Rest/MicrovisorBase.php new file mode 100644 index 0000000..aa2c915 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/MicrovisorBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://microvisor.twilio.com'; + } + + + /** + * @return V1 Version v1 of microvisor + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Microvisor]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor.php new file mode 100644 index 0000000..a1f9291 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor.php @@ -0,0 +1,41 @@ +alerts instead. + */ + protected function getAlerts(): \Twilio\Rest\Monitor\V1\AlertList { + echo "alerts is deprecated. Use v1->alerts instead."; + return $this->v1->alerts; + } + + /** + * @deprecated Use v1->alerts(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextAlerts(string $sid): \Twilio\Rest\Monitor\V1\AlertContext { + echo "alerts(\$sid) is deprecated. Use v1->alerts(\$sid) instead."; + return $this->v1->alerts($sid); + } + + /** + * @deprecated Use v1->events instead. + */ + protected function getEvents(): \Twilio\Rest\Monitor\V1\EventList { + echo "events is deprecated. Use v1->events instead."; + return $this->v1->events; + } + + /** + * @deprecated Use v1->events(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextEvents(string $sid): \Twilio\Rest\Monitor\V1\EventContext { + echo "events(\$sid) is deprecated. Use v1->events(\$sid) instead."; + return $this->v1->events($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1.php new file mode 100644 index 0000000..36c7af5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getAlerts(): AlertList + { + if (!$this->_alerts) { + $this->_alerts = new AlertList($this); + } + return $this->_alerts; + } + + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList($this); + } + return $this->_events; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Monitor.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php new file mode 100644 index 0000000..d7c0e3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Alerts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AlertInstance + * + * @return AlertInstance Fetched AlertInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlertInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AlertInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.AlertContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php new file mode 100644 index 0000000..f687fc5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'alertText' => Values::array_get($payload, 'alert_text'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateGenerated' => Deserialize::dateTime(Values::array_get($payload, 'date_generated')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'logLevel' => Values::array_get($payload, 'log_level'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'requestHeaders' => Values::array_get($payload, 'request_headers'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AlertContext Context for this AlertInstance + */ + protected function proxy(): AlertContext + { + if (!$this->context) { + $this->context = new AlertContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AlertInstance + * + * @return AlertInstance Fetched AlertInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlertInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.AlertInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertList.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertList.php new file mode 100644 index 0000000..1d244eb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertList.php @@ -0,0 +1,173 @@ +solution = [ + ]; + + $this->uri = '/Alerts'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AlertInstance 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 AlertPage Page of AlertInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AlertPage + { + $options = new Values($options); + + $params = Values::of([ + 'LogLevel' => + $options['logLevel'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new 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 AlertPage Page of AlertInstance + */ + public function getPage(string $targetUrl): AlertPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AlertPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AlertContext + * + * @param string $sid The SID of the Alert resource to fetch. + */ + public function getContext( + string $sid + + ): AlertContext + { + return new AlertContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.AlertList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php new file mode 100644 index 0000000..1ceaa62 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php @@ -0,0 +1,114 @@ +options['logLevel'] = $logLevel; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. + * + * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. + * @return $this Fluent Builder + */ + public function setLogLevel(string $logLevel): self + { + $this->options['logLevel'] = $logLevel; + return $this; + } + + /** + * Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * + * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * + * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Monitor.V1.ReadAlertOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php new file mode 100644 index 0000000..65c082b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AlertInstance \Twilio\Rest\Monitor\V1\AlertInstance + */ + public function buildInstance(array $payload): AlertInstance + { + return new AlertInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.AlertPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventContext.php new file mode 100644 index 0000000..5dc7d24 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Events/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EventInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.EventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php new file mode 100644 index 0000000..c55f04e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php @@ -0,0 +1,142 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EventContext Context for this EventInstance + */ + protected function proxy(): EventContext + { + if (!$this->context) { + $this->context = new EventContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.EventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventList.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventList.php new file mode 100644 index 0000000..3edfc77 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/Events'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance 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 EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'ActorSid' => + $options['actorSid'], + 'EventType' => + $options['eventType'], + 'ResourceSid' => + $options['resourceSid'], + 'SourceIpAddress' => + $options['sourceIpAddress'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventContext + * + * @param string $sid The SID of the Event resource to fetch. + */ + public function getContext( + string $sid + + ): EventContext + { + return new EventContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.EventList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php new file mode 100644 index 0000000..ce8b9c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php @@ -0,0 +1,168 @@ +options['actorSid'] = $actorSid; + $this->options['eventType'] = $eventType; + $this->options['resourceSid'] = $resourceSid; + $this->options['sourceIpAddress'] = $sourceIpAddress; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. + * + * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. + * @return $this Fluent Builder + */ + public function setActorSid(string $actorSid): self + { + $this->options['actorSid'] = $actorSid; + return $this; + } + + /** + * Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). + * + * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). + * @return $this Fluent Builder + */ + public function setEventType(string $eventType): self + { + $this->options['eventType'] = $eventType; + return $this; + } + + /** + * Only include events that refer to this resource. Useful for discovering the history of a specific resource. + * + * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. + * @return $this Fluent Builder + */ + public function setResourceSid(string $resourceSid): self + { + $this->options['resourceSid'] = $resourceSid; + return $this; + } + + /** + * Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. + * + * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. + * @return $this Fluent Builder + */ + public function setSourceIpAddress(string $sourceIpAddress): self + { + $this->options['sourceIpAddress'] = $sourceIpAddress; + return $this; + } + + /** + * Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Monitor.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventPage.php new file mode 100644 index 0000000..0288578 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Monitor/V1/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Monitor\V1\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.EventPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/MonitorBase.php b/vendor/twilio/sdk/src/Twilio/Rest/MonitorBase.php new file mode 100644 index 0000000..8fc1451 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/MonitorBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://monitor.twilio.com'; + } + + + /** + * @return V1 Version v1 of monitor + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Monitor]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify.php new file mode 100644 index 0000000..f2bcfbb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify.php @@ -0,0 +1,41 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Notify\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->credentials(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Notify\V1\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; + return $this->v1->credentials($sid); + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Notify\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Notify\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1.php new file mode 100644 index 0000000..35d718f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Notify.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialContext.php new file mode 100644 index 0000000..8bb59c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialInstance.php new file mode 100644 index 0000000..1d0282c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialList.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialList.php new file mode 100644 index 0000000..d95d93b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + '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 CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.CredentialList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialOptions.php new file mode 100644 index 0000000..083fc67 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialPage.php new file mode 100644 index 0000000..8a9e2de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Notify\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.CredentialPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingContext.php new file mode 100644 index 0000000..b0c3759 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingContext.php @@ -0,0 +1,103 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingInstance.php new file mode 100644 index 0000000..9bca8c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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 = ['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 BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingList.php new file mode 100644 index 0000000..131e715 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * Create the BindingInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20 Bindings can be created for the same Identity in a given Service. + * @param string $bindingType + * @param string $address The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format. + * @param array|Options $options Optional Arguments + * @return BindingInstance Created BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, string $bindingType, string $address, array $options = []): BindingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'BindingType' => + $bindingType, + 'Address' => + $address, + 'Tag' => + Serialize::map($options['tag'], function ($e) { return $e; }), + 'NotificationProtocolVersion' => + $options['notificationProtocolVersion'], + 'CredentialSid' => + $options['credentialSid'], + 'Endpoint' => + $options['endpoint'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance 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 BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + '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 BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.BindingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingOptions.php new file mode 100644 index 0000000..81070e5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingOptions.php @@ -0,0 +1,240 @@ +options['tag'] = $tag; + $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; + $this->options['credentialSid'] = $credentialSid; + $this->options['endpoint'] = $endpoint; + } + + /** + * A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. + * + * @param string[] $tag A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. + * + * @param string $notificationProtocolVersion The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. + * @return $this Fluent Builder + */ + public function setNotificationProtocolVersion(string $notificationProtocolVersion): self + { + $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. + * + * @param string $credentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. + * @return $this Fluent Builder + */ + public function setCredentialSid(string $credentialSid): self + { + $this->options['credentialSid'] = $credentialSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $endpoint Deprecated. + * @return $this Fluent Builder + */ + public function setEndpoint(string $endpoint): self + { + $this->options['endpoint'] = $endpoint; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateBindingOptions ' . $options . ']'; + } +} + + + +class ReadBindingOptions extends Options + { + /** + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + */ + public function __construct( + + \DateTime $startDate = null, + \DateTime $endDate = null, + array $identity = Values::ARRAY_NONE, + array $tag = Values::ARRAY_NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['identity'] = $identity; + $this->options['tag'] = $tag; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + * + * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingPage.php new file mode 100644 index 0000000..15dab16 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Notify\V1\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.BindingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationInstance.php new file mode 100644 index 0000000..20ac685 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationInstance.php @@ -0,0 +1,120 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationList.php new file mode 100644 index 0000000..8756960 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationList.php @@ -0,0 +1,123 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Notifications'; + } + + /** + * Create the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Created NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Priority' => + $options['priority'], + 'Ttl' => + $options['ttl'], + 'Title' => + $options['title'], + 'Sound' => + $options['sound'], + 'Action' => + $options['action'], + 'Data' => + Serialize::jsonObject($options['data']), + 'Apn' => + Serialize::jsonObject($options['apn']), + 'Gcm' => + Serialize::jsonObject($options['gcm']), + 'Sms' => + Serialize::jsonObject($options['sms']), + 'FacebookMessenger' => + Serialize::jsonObject($options['facebookMessenger']), + 'Fcm' => + Serialize::jsonObject($options['fcm']), + 'Segment' => + Serialize::map($options['segment'], function ($e) { return $e; }), + 'Alexa' => + Serialize::jsonObject($options['alexa']), + 'ToBinding' => + Serialize::map($options['toBinding'], function ($e) { return $e; }), + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'Tag' => + Serialize::map($options['tag'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.php new file mode 100644 index 0000000..fe7c760 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.php @@ -0,0 +1,380 @@ +options['identity'] = $identity; + $this->options['tag'] = $tag; + $this->options['body'] = $body; + $this->options['priority'] = $priority; + $this->options['ttl'] = $ttl; + $this->options['title'] = $title; + $this->options['sound'] = $sound; + $this->options['action'] = $action; + $this->options['data'] = $data; + $this->options['apn'] = $apn; + $this->options['gcm'] = $gcm; + $this->options['sms'] = $sms; + $this->options['facebookMessenger'] = $facebookMessenger; + $this->options['fcm'] = $fcm; + $this->options['segment'] = $segment; + $this->options['alexa'] = $alexa; + $this->options['toBinding'] = $toBinding; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + } + + /** + * The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. + * + * @param string[] $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. + * + * @param string[] $tag A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. + * + * @param string $body The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * @param string $priority + * @return $this Fluent Builder + */ + public function setPriority(string $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. + * + * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. + * + * @param string $title The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. + * @return $this Fluent Builder + */ + public function setTitle(string $title): self + { + $this->options['title'] = $title; + return $this; + } + + /** + * The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. + * + * @param string $sound The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. + * @return $this Fluent Builder + */ + public function setSound(string $sound): self + { + $this->options['sound'] = $sound; + return $this; + } + + /** + * The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * + * @param string $action The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * @return $this Fluent Builder + */ + public function setAction(string $action): self + { + $this->options['action'] = $action; + return $this; + } + + /** + * The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * + * @param array $data The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + * + * @param array $apn The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + * @return $this Fluent Builder + */ + public function setApn(array $apn): self + { + $this->options['apn'] = $apn; + return $this; + } + + /** + * The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). + * + * @param array $gcm The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). + * @return $this Fluent Builder + */ + public function setGcm(array $gcm): self + { + $this->options['gcm'] = $gcm; + return $this; + } + + /** + * The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + * + * @param array $sms The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + * @return $this Fluent Builder + */ + public function setSms(array $sms): self + { + $this->options['sms'] = $sms; + return $this; + } + + /** + * Deprecated. + * + * @param array $facebookMessenger Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessenger(array $facebookMessenger): self + { + $this->options['facebookMessenger'] = $facebookMessenger; + return $this; + } + + /** + * The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. + * + * @param array $fcm The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. + * @return $this Fluent Builder + */ + public function setFcm(array $fcm): self + { + $this->options['fcm'] = $fcm; + return $this; + } + + /** + * The Segment resource is deprecated. Use the `tag` parameter, instead. + * + * @param string[] $segment The Segment resource is deprecated. Use the `tag` parameter, instead. + * @return $this Fluent Builder + */ + public function setSegment(array $segment): self + { + $this->options['segment'] = $segment; + return $this; + } + + /** + * Deprecated. + * + * @param array $alexa Deprecated. + * @return $this Fluent Builder + */ + public function setAlexa(array $alexa): self + { + $this->options['alexa'] = $alexa; + return $this; + } + + /** + * The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. + * + * @param string[] $toBinding The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. + * @return $this Fluent Builder + */ + public function setToBinding(array $toBinding): self + { + $this->options['toBinding'] = $toBinding; + return $this; + } + + /** + * URL to send webhooks. + * + * @param string $deliveryCallbackUrl URL to send webhooks. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateNotificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationPage.php new file mode 100644 index 0000000..b73d417 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/Service/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Notify\V1\Service\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceContext.php new file mode 100644 index 0000000..c379c99 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceContext.php @@ -0,0 +1,229 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApnCredentialSid' => + $options['apnCredentialSid'], + 'GcmCredentialSid' => + $options['gcmCredentialSid'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'FacebookMessengerPageId' => + $options['facebookMessengerPageId'], + 'DefaultApnNotificationProtocolVersion' => + $options['defaultApnNotificationProtocolVersion'], + 'DefaultGcmNotificationProtocolVersion' => + $options['defaultGcmNotificationProtocolVersion'], + 'FcmCredentialSid' => + $options['fcmCredentialSid'], + 'DefaultFcmNotificationProtocolVersion' => + $options['defaultFcmNotificationProtocolVersion'], + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'AlexaSkillId' => + $options['alexaSkillId'], + 'DefaultAlexaNotificationProtocolVersion' => + $options['defaultAlexaNotificationProtocolVersion'], + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'DeliveryCallbackEnabled' => + Serialize::booleanToString($options['deliveryCallbackEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceInstance.php new file mode 100644 index 0000000..59e5ff7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceInstance.php @@ -0,0 +1,201 @@ +properties = [ + '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'), + 'deliveryCallbackUrl' => Values::array_get($payload, 'delivery_callback_url'), + 'deliveryCallbackEnabled' => Values::array_get($payload, 'delivery_callback_enabled'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceList.php new file mode 100644 index 0000000..c144e88 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceList.php @@ -0,0 +1,223 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApnCredentialSid' => + $options['apnCredentialSid'], + 'GcmCredentialSid' => + $options['gcmCredentialSid'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'FacebookMessengerPageId' => + $options['facebookMessengerPageId'], + 'DefaultApnNotificationProtocolVersion' => + $options['defaultApnNotificationProtocolVersion'], + 'DefaultGcmNotificationProtocolVersion' => + $options['defaultGcmNotificationProtocolVersion'], + 'FcmCredentialSid' => + $options['fcmCredentialSid'], + 'DefaultFcmNotificationProtocolVersion' => + $options['defaultFcmNotificationProtocolVersion'], + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'AlexaSkillId' => + $options['alexaSkillId'], + 'DefaultAlexaNotificationProtocolVersion' => + $options['defaultAlexaNotificationProtocolVersion'], + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'DeliveryCallbackEnabled' => + Serialize::booleanToString($options['deliveryCallbackEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + $options = new Values($options); + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceOptions.php new file mode 100644 index 0000000..29717bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServiceOptions.php @@ -0,0 +1,652 @@ +options['friendlyName'] = $friendlyName; + $this->options['apnCredentialSid'] = $apnCredentialSid; + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + $this->options['logEnabled'] = $logEnabled; + $this->options['alexaSkillId'] = $alexaSkillId; + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @return $this Fluent Builder + */ + public function setApnCredentialSid(string $apnCredentialSid): self + { + $this->options['apnCredentialSid'] = $apnCredentialSid; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @return $this Fluent Builder + */ + public function setGcmCredentialSid(string $gcmCredentialSid): self + { + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $facebookMessengerPageId Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessengerPageId(string $facebookMessengerPageId): self + { + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + return $this; + } + + /** + * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self + { + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + return $this; + } + + /** + * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self + { + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @return $this Fluent Builder + */ + public function setFcmCredentialSid(string $fcmCredentialSid): self + { + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + return $this; + } + + /** + * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self + { + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + return $this; + } + + /** + * Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param string $alexaSkillId Deprecated. + * @return $this Fluent Builder + */ + public function setAlexaSkillId(string $alexaSkillId): self + { + $this->options['alexaSkillId'] = $alexaSkillId; + return $this; + } + + /** + * Deprecated. + * + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @return $this Fluent Builder + */ + public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self + { + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + return $this; + } + + /** + * URL to send delivery status callback. + * + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Callback configuration that enables delivery callbacks, default false + * + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + * @return $this Fluent Builder + */ + public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self + { + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + +class ReadServiceOptions extends Options + { + /** + * @param string $friendlyName The string that identifies the Service resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The string that identifies the Service resources to read. + * + * @param string $friendlyName The string that identifies the Service resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.ReadServiceOptions ' . $options . ']'; + } +} + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @param string $facebookMessengerPageId Deprecated. + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @param string $alexaSkillId Deprecated. + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apnCredentialSid = Values::NONE, + string $gcmCredentialSid = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $facebookMessengerPageId = Values::NONE, + string $defaultApnNotificationProtocolVersion = Values::NONE, + string $defaultGcmNotificationProtocolVersion = Values::NONE, + string $fcmCredentialSid = Values::NONE, + string $defaultFcmNotificationProtocolVersion = Values::NONE, + bool $logEnabled = Values::BOOL_NONE, + string $alexaSkillId = Values::NONE, + string $defaultAlexaNotificationProtocolVersion = Values::NONE, + string $deliveryCallbackUrl = Values::NONE, + bool $deliveryCallbackEnabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['apnCredentialSid'] = $apnCredentialSid; + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + $this->options['logEnabled'] = $logEnabled; + $this->options['alexaSkillId'] = $alexaSkillId; + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @return $this Fluent Builder + */ + public function setApnCredentialSid(string $apnCredentialSid): self + { + $this->options['apnCredentialSid'] = $apnCredentialSid; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @return $this Fluent Builder + */ + public function setGcmCredentialSid(string $gcmCredentialSid): self + { + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $facebookMessengerPageId Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessengerPageId(string $facebookMessengerPageId): self + { + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + return $this; + } + + /** + * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self + { + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + return $this; + } + + /** + * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self + { + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @return $this Fluent Builder + */ + public function setFcmCredentialSid(string $fcmCredentialSid): self + { + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + return $this; + } + + /** + * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self + { + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + return $this; + } + + /** + * Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param string $alexaSkillId Deprecated. + * @return $this Fluent Builder + */ + public function setAlexaSkillId(string $alexaSkillId): self + { + $this->options['alexaSkillId'] = $alexaSkillId; + return $this; + } + + /** + * Deprecated. + * + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @return $this Fluent Builder + */ + public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self + { + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + return $this; + } + + /** + * URL to send delivery status callback. + * + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Callback configuration that enables delivery callbacks, default false + * + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + * @return $this Fluent Builder + */ + public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self + { + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServicePage.php new file mode 100644 index 0000000..186643f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Notify/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Notify\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/NotifyBase.php b/vendor/twilio/sdk/src/Twilio/Rest/NotifyBase.php new file mode 100644 index 0000000..fb3b7b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/NotifyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://notify.twilio.com'; + } + + + /** + * @return V1 Version v1 of notify + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Notify]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers.php new file mode 100644 index 0000000..eff942d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers.php @@ -0,0 +1,16 @@ +regulatoryCompliance instead. + */ + protected function getRegulatoryCompliance(): \Twilio\Rest\Numbers\V2\RegulatoryComplianceList { + echo "regulatoryCompliance is deprecated. Use v2->regulatoryCompliance instead."; + return $this->v2->regulatoryCompliance; + } + +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1.php new file mode 100644 index 0000000..02cf263 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1.php @@ -0,0 +1,187 @@ +version = 'v1'; + } + + protected function getBulkEligibilities(): BulkEligibilityList + { + if (!$this->_bulkEligibilities) { + $this->_bulkEligibilities = new BulkEligibilityList($this); + } + return $this->_bulkEligibilities; + } + + protected function getEligibilities(): EligibilityList + { + if (!$this->_eligibilities) { + $this->_eligibilities = new EligibilityList($this); + } + return $this->_eligibilities; + } + + protected function getPortingPortIns(): PortingPortInList + { + if (!$this->_portingPortIns) { + $this->_portingPortIns = new PortingPortInList($this); + } + return $this->_portingPortIns; + } + + protected function getPortingPortInPhoneNumber(): PortingPortInPhoneNumberList + { + if (!$this->_portingPortInPhoneNumber) { + $this->_portingPortInPhoneNumber = new PortingPortInPhoneNumberList($this); + } + return $this->_portingPortInPhoneNumber; + } + + protected function getPortingPortabilities(): PortingPortabilityList + { + if (!$this->_portingPortabilities) { + $this->_portingPortabilities = new PortingPortabilityList($this); + } + return $this->_portingPortabilities; + } + + protected function getPortingWebhookConfigurations(): PortingWebhookConfigurationList + { + if (!$this->_portingWebhookConfigurations) { + $this->_portingWebhookConfigurations = new PortingWebhookConfigurationList($this); + } + return $this->_portingWebhookConfigurations; + } + + protected function getPortingWebhookConfigurationsDelete(): PortingWebhookConfigurationDeleteList + { + if (!$this->_portingWebhookConfigurationsDelete) { + $this->_portingWebhookConfigurationsDelete = new PortingWebhookConfigurationDeleteList($this); + } + return $this->_portingWebhookConfigurationsDelete; + } + + protected function getSigningRequestConfigurations(): SigningRequestConfigurationList + { + if (!$this->_signingRequestConfigurations) { + $this->_signingRequestConfigurations = new SigningRequestConfigurationList($this); + } + return $this->_signingRequestConfigurations; + } + + protected function getWebhook(): WebhookList + { + if (!$this->_webhook) { + $this->_webhook = new WebhookList($this); + } + return $this->_webhook; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Numbers.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php new file mode 100644 index 0000000..79582d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php @@ -0,0 +1,83 @@ +solution = [ + 'requestId' => + $requestId, + ]; + + $this->uri = '/HostedNumber/Eligibility/Bulk/' . \rawurlencode($requestId) + .''; + } + + /** + * Fetch the BulkEligibilityInstance + * + * @return BulkEligibilityInstance Fetched BulkEligibilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BulkEligibilityInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BulkEligibilityInstance( + $this->version, + $payload, + $this->solution['requestId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.BulkEligibilityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityInstance.php new file mode 100644 index 0000000..35ad7c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityInstance.php @@ -0,0 +1,128 @@ +properties = [ + 'requestId' => Values::array_get($payload, 'request_id'), + 'url' => Values::array_get($payload, 'url'), + 'results' => Values::array_get($payload, 'results'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + ]; + + $this->solution = ['requestId' => $requestId ?: $this->properties['requestId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BulkEligibilityContext Context for this BulkEligibilityInstance + */ + protected function proxy(): BulkEligibilityContext + { + if (!$this->context) { + $this->context = new BulkEligibilityContext( + $this->version, + $this->solution['requestId'] + ); + } + + return $this->context; + } + + /** + * Fetch the BulkEligibilityInstance + * + * @return BulkEligibilityInstance Fetched BulkEligibilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BulkEligibilityInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.BulkEligibilityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php new file mode 100644 index 0000000..f43b3e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php @@ -0,0 +1,90 @@ +solution = [ + ]; + + $this->uri = '/HostedNumber/Eligibility/Bulk'; + } + + /** + * Create the BulkEligibilityInstance + * + * @return BulkEligibilityInstance Created BulkEligibilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BulkEligibilityInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BulkEligibilityInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a BulkEligibilityContext + * + * @param string $requestId The SID of the bulk eligibility check that you want to know about. + */ + public function getContext( + string $requestId + + ): BulkEligibilityContext + { + return new BulkEligibilityContext( + $this->version, + $requestId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.BulkEligibilityList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityPage.php new file mode 100644 index 0000000..173f7ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BulkEligibilityInstance \Twilio\Rest\Numbers\V1\BulkEligibilityInstance + */ + public function buildInstance(array $payload): BulkEligibilityInstance + { + return new BulkEligibilityInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.BulkEligibilityPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php new file mode 100644 index 0000000..6121a62 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'results' => Values::array_get($payload, 'results'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.EligibilityInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityList.php new file mode 100644 index 0000000..8ba9c64 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityList.php @@ -0,0 +1,74 @@ +solution = [ + ]; + + $this->uri = '/HostedNumber/Eligibility'; + } + + /** + * Create the EligibilityInstance + * + * @return EligibilityInstance Created EligibilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): EligibilityInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EligibilityInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.EligibilityList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityPage.php new file mode 100644 index 0000000..e93779b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/EligibilityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EligibilityInstance \Twilio\Rest\Numbers\V1\EligibilityInstance + */ + public function buildInstance(array $payload): EligibilityInstance + { + return new EligibilityInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.EligibilityPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInContext.php new file mode 100644 index 0000000..95cff83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInContext.php @@ -0,0 +1,97 @@ +solution = [ + 'portInRequestSid' => + $portInRequestSid, + ]; + + $this->uri = '/Porting/PortIn/' . \rawurlencode($portInRequestSid) + .''; + } + + /** + * Delete the PortingPortInInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PortingPortInInstance + * + * @return PortingPortInInstance Fetched PortingPortInInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PortingPortInInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PortingPortInInstance( + $this->version, + $payload, + $this->solution['portInRequestSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortInContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php new file mode 100644 index 0000000..26a1bf0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'portInRequestSid' => Values::array_get($payload, 'port_in_request_sid'), + 'url' => Values::array_get($payload, 'url'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'notificationEmails' => Values::array_get($payload, 'notification_emails'), + 'targetPortInDate' => Deserialize::dateTime(Values::array_get($payload, 'target_port_in_date')), + 'targetPortInTimeRangeStart' => Values::array_get($payload, 'target_port_in_time_range_start'), + 'targetPortInTimeRangeEnd' => Values::array_get($payload, 'target_port_in_time_range_end'), + 'portInRequestStatus' => Values::array_get($payload, 'port_in_request_status'), + 'losingCarrierInformation' => Values::array_get($payload, 'losing_carrier_information'), + 'phoneNumbers' => Values::array_get($payload, 'phone_numbers'), + 'documents' => Values::array_get($payload, 'documents'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['portInRequestSid' => $portInRequestSid ?: $this->properties['portInRequestSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PortingPortInContext Context for this PortingPortInInstance + */ + protected function proxy(): PortingPortInContext + { + if (!$this->context) { + $this->context = new PortingPortInContext( + $this->version, + $this->solution['portInRequestSid'] + ); + } + + return $this->context; + } + + /** + * Delete the PortingPortInInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PortingPortInInstance + * + * @return PortingPortInInstance Fetched PortingPortInInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PortingPortInInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortInInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInList.php new file mode 100644 index 0000000..e68f9ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInList.php @@ -0,0 +1,90 @@ +solution = [ + ]; + + $this->uri = '/Porting/PortIn'; + } + + /** + * Create the PortingPortInInstance + * + * @return PortingPortInInstance Created PortingPortInInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): PortingPortInInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PortingPortInInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a PortingPortInContext + * + * @param string $portInRequestSid The SID of the Port In request. This is a unique identifier of the port in request. + */ + public function getContext( + string $portInRequestSid + + ): PortingPortInContext + { + return new PortingPortInContext( + $this->version, + $portInRequestSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPage.php new file mode 100644 index 0000000..5ab6205 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PortingPortInInstance \Twilio\Rest\Numbers\V1\PortingPortInInstance + */ + public function buildInstance(array $payload): PortingPortInInstance + { + return new PortingPortInInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberContext.php new file mode 100644 index 0000000..95a41e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberContext.php @@ -0,0 +1,103 @@ +solution = [ + 'portInRequestSid' => + $portInRequestSid, + 'phoneNumberSid' => + $phoneNumberSid, + ]; + + $this->uri = '/Porting/PortIn/' . \rawurlencode($portInRequestSid) + .'/PhoneNumber/' . \rawurlencode($phoneNumberSid) + .''; + } + + /** + * Delete the PortingPortInPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PortingPortInPhoneNumberInstance + * + * @return PortingPortInPhoneNumberInstance Fetched PortingPortInPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PortingPortInPhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PortingPortInPhoneNumberInstance( + $this->version, + $payload, + $this->solution['portInRequestSid'], + $this->solution['phoneNumberSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortInPhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberInstance.php new file mode 100644 index 0000000..64aca42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'portInRequestSid' => Values::array_get($payload, 'port_in_request_sid'), + 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), + 'url' => Values::array_get($payload, 'url'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'phoneNumberType' => Values::array_get($payload, 'phone_number_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'country' => Values::array_get($payload, 'country'), + 'missingRequiredFields' => Values::array_get($payload, 'missing_required_fields'), + 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'portable' => Values::array_get($payload, 'portable'), + 'notPortabilityReason' => Values::array_get($payload, 'not_portability_reason'), + 'notPortabilityReasonCode' => Values::array_get($payload, 'not_portability_reason_code'), + 'portInPhoneNumberStatus' => Values::array_get($payload, 'port_in_phone_number_status'), + 'portOutPin' => Values::array_get($payload, 'port_out_pin'), + 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), + 'rejectionReasonCode' => Values::array_get($payload, 'rejection_reason_code'), + ]; + + $this->solution = ['portInRequestSid' => $portInRequestSid ?: $this->properties['portInRequestSid'], 'phoneNumberSid' => $phoneNumberSid ?: $this->properties['phoneNumberSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PortingPortInPhoneNumberContext Context for this PortingPortInPhoneNumberInstance + */ + protected function proxy(): PortingPortInPhoneNumberContext + { + if (!$this->context) { + $this->context = new PortingPortInPhoneNumberContext( + $this->version, + $this->solution['portInRequestSid'], + $this->solution['phoneNumberSid'] + ); + } + + return $this->context; + } + + /** + * Delete the PortingPortInPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PortingPortInPhoneNumberInstance + * + * @return PortingPortInPhoneNumberInstance Fetched PortingPortInPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PortingPortInPhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortInPhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberList.php new file mode 100644 index 0000000..0282187 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a PortingPortInPhoneNumberContext + * + * @param string $portInRequestSid The SID of the Port In request. This is a unique identifier of the port in request. + * + * @param string $phoneNumberSid The SID of the Port In request phone number. This is a unique identifier of the phone number. + */ + public function getContext( + string $portInRequestSid + , string $phoneNumberSid + + ): PortingPortInPhoneNumberContext + { + return new PortingPortInPhoneNumberContext( + $this->version, + $portInRequestSid, + $phoneNumberSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInPhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberPage.php new file mode 100644 index 0000000..edbfe4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortInPhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PortingPortInPhoneNumberInstance \Twilio\Rest\Numbers\V1\PortingPortInPhoneNumberInstance + */ + public function buildInstance(array $payload): PortingPortInPhoneNumberInstance + { + return new PortingPortInPhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInPhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php new file mode 100644 index 0000000..f113d70 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php @@ -0,0 +1,92 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/Porting/Portability/PhoneNumber/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PortingPortabilityInstance + * + * @param array|Options $options Optional Arguments + * @return PortingPortabilityInstance Fetched PortingPortabilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PortingPortabilityInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TargetAccountSid' => + $options['targetAccountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new PortingPortabilityInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortabilityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityInstance.php new file mode 100644 index 0000000..b4d7696 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'portable' => Values::array_get($payload, 'portable'), + 'pinAndAccountNumberRequired' => Values::array_get($payload, 'pin_and_account_number_required'), + 'notPortableReason' => Values::array_get($payload, 'not_portable_reason'), + 'notPortableReasonCode' => Values::array_get($payload, 'not_portable_reason_code'), + 'numberType' => Values::array_get($payload, 'number_type'), + 'country' => Values::array_get($payload, 'country'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 PortingPortabilityContext Context for this PortingPortabilityInstance + */ + protected function proxy(): PortingPortabilityContext + { + if (!$this->context) { + $this->context = new PortingPortabilityContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PortingPortabilityInstance + * + * @param array|Options $options Optional Arguments + * @return PortingPortabilityInstance Fetched PortingPortabilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PortingPortabilityInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingPortabilityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityList.php new file mode 100644 index 0000000..8ab9fa6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PortingPortabilityContext + * + * @param string $phoneNumber The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). + */ + public function getContext( + string $phoneNumber + + ): PortingPortabilityContext + { + return new PortingPortabilityContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortabilityList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityOptions.php new file mode 100644 index 0000000..568f5b1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityOptions.php @@ -0,0 +1,76 @@ +options['targetAccountSid'] = $targetAccountSid; + } + + /** + * The SID of the account where the phone number(s) will be ported. + * + * @param string $targetAccountSid The SID of the account where the phone number(s) will be ported. + * @return $this Fluent Builder + */ + public function setTargetAccountSid(string $targetAccountSid): self + { + $this->options['targetAccountSid'] = $targetAccountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V1.FetchPortingPortabilityOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityPage.php new file mode 100644 index 0000000..253298e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PortingPortabilityInstance \Twilio\Rest\Numbers\V1\PortingPortabilityInstance + */ + public function buildInstance(array $payload): PortingPortabilityInstance + { + return new PortingPortabilityInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortabilityPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteContext.php new file mode 100644 index 0000000..c4c86b2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteContext.php @@ -0,0 +1,77 @@ +solution = [ + 'webhookType' => + $webhookType, + ]; + + $this->uri = '/Porting/Configuration/Webhook/' . \rawurlencode($webhookType) + .''; + } + + /** + * Delete the PortingWebhookConfigurationDeleteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingWebhookConfigurationDeleteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteInstance.php new file mode 100644 index 0000000..1d4790d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteInstance.php @@ -0,0 +1,106 @@ +solution = ['webhookType' => $webhookType ?: $this->properties['webhookType'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PortingWebhookConfigurationDeleteContext Context for this PortingWebhookConfigurationDeleteInstance + */ + protected function proxy(): PortingWebhookConfigurationDeleteContext + { + if (!$this->context) { + $this->context = new PortingWebhookConfigurationDeleteContext( + $this->version, + $this->solution['webhookType'] + ); + } + + return $this->context; + } + + /** + * Delete the PortingWebhookConfigurationDeleteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V1.PortingWebhookConfigurationDeleteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteList.php new file mode 100644 index 0000000..c753f4f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeleteList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PortingWebhookConfigurationDeleteContext + * + * @param string $webhookType The of the webhook type of the configuration to be deleted + */ + public function getContext( + string $webhookType + + ): PortingWebhookConfigurationDeleteContext + { + return new PortingWebhookConfigurationDeleteContext( + $this->version, + $webhookType + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingWebhookConfigurationDeleteList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeletePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeletePage.php new file mode 100644 index 0000000..17b0515 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationDeletePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PortingWebhookConfigurationDeleteInstance \Twilio\Rest\Numbers\V1\PortingWebhookConfigurationDeleteInstance + */ + public function buildInstance(array $payload): PortingWebhookConfigurationDeleteInstance + { + return new PortingWebhookConfigurationDeleteInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingWebhookConfigurationDeletePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationInstance.php new file mode 100644 index 0000000..96d77ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationInstance.php @@ -0,0 +1,86 @@ +properties = [ + 'url' => Values::array_get($payload, 'url'), + 'portInTargetUrl' => Values::array_get($payload, 'port_in_target_url'), + 'portOutTargetUrl' => Values::array_get($payload, 'port_out_target_url'), + 'notificationsOf' => Values::array_get($payload, 'notifications_of'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingWebhookConfigurationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationList.php new file mode 100644 index 0000000..67d849e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationList.php @@ -0,0 +1,74 @@ +solution = [ + ]; + + $this->uri = '/Porting/Configuration/Webhook'; + } + + /** + * Create the PortingWebhookConfigurationInstance + * + * @return PortingWebhookConfigurationInstance Created PortingWebhookConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): PortingWebhookConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PortingWebhookConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingWebhookConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationPage.php new file mode 100644 index 0000000..87d57d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/PortingWebhookConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PortingWebhookConfigurationInstance \Twilio\Rest\Numbers\V1\PortingWebhookConfigurationInstance + */ + public function buildInstance(array $payload): PortingWebhookConfigurationInstance + { + return new PortingWebhookConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingWebhookConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationInstance.php new file mode 100644 index 0000000..df459f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationInstance.php @@ -0,0 +1,94 @@ +properties = [ + 'logoSid' => Values::array_get($payload, 'logo_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'product' => Values::array_get($payload, 'product'), + 'country' => Values::array_get($payload, 'country'), + 'emailSubject' => Values::array_get($payload, 'email_subject'), + 'emailMessage' => Values::array_get($payload, 'email_message'), + 'urlRedirection' => Values::array_get($payload, 'url_redirection'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.SigningRequestConfigurationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationList.php new file mode 100644 index 0000000..ca504f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationList.php @@ -0,0 +1,74 @@ +solution = [ + ]; + + $this->uri = '/SigningRequest/Configuration'; + } + + /** + * Create the SigningRequestConfigurationInstance + * + * @return SigningRequestConfigurationInstance Created SigningRequestConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SigningRequestConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SigningRequestConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.SigningRequestConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationPage.php new file mode 100644 index 0000000..05466ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/SigningRequestConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SigningRequestConfigurationInstance \Twilio\Rest\Numbers\V1\SigningRequestConfigurationInstance + */ + public function buildInstance(array $payload): SigningRequestConfigurationInstance + { + return new SigningRequestConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.SigningRequestConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookInstance.php new file mode 100644 index 0000000..7bd511c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookInstance.php @@ -0,0 +1,91 @@ +properties = [ + 'url' => Values::array_get($payload, 'url'), + 'portInTargetUrl' => Values::array_get($payload, 'port_in_target_url'), + 'portOutTargetUrl' => Values::array_get($payload, 'port_out_target_url'), + 'notificationsOf' => Values::array_get($payload, 'notifications_of'), + 'portInTargetDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'port_in_target_date_created')), + 'portOutTargetDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'port_out_target_date_created')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.WebhookInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookList.php new file mode 100644 index 0000000..df0e656 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookList.php @@ -0,0 +1,72 @@ +solution = [ + ]; + + $this->uri = '/Porting/Configuration/Webhook'; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookPage.php new file mode 100644 index 0000000..e711a76 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V1/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Numbers\V1\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2.php new file mode 100644 index 0000000..bfda520 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2.php @@ -0,0 +1,130 @@ +version = 'v2'; + } + + protected function getAuthorizationDocuments(): AuthorizationDocumentList + { + if (!$this->_authorizationDocuments) { + $this->_authorizationDocuments = new AuthorizationDocumentList($this); + } + return $this->_authorizationDocuments; + } + + protected function getBulkHostedNumberOrders(): BulkHostedNumberOrderList + { + if (!$this->_bulkHostedNumberOrders) { + $this->_bulkHostedNumberOrders = new BulkHostedNumberOrderList($this); + } + return $this->_bulkHostedNumberOrders; + } + + protected function getHostedNumberOrders(): HostedNumberOrderList + { + if (!$this->_hostedNumberOrders) { + $this->_hostedNumberOrders = new HostedNumberOrderList($this); + } + return $this->_hostedNumberOrders; + } + + protected function getRegulatoryCompliance(): RegulatoryComplianceList + { + if (!$this->_regulatoryCompliance) { + $this->_regulatoryCompliance = new RegulatoryComplianceList($this); + } + return $this->_regulatoryCompliance; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Numbers.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderInstance.php new file mode 100644 index 0000000..2f1c827 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderInstance.php @@ -0,0 +1,117 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'bulkHostingRequestSid' => Values::array_get($payload, 'bulk_hosting_request_sid'), + 'nextStep' => Values::array_get($payload, 'next_step'), + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'friendlyName' => Values::array_get($payload, 'friendly_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')), + 'email' => Values::array_get($payload, 'email'), + 'ccEmails' => Values::array_get($payload, 'cc_emails'), + 'contactTitle' => Values::array_get($payload, 'contact_title'), + 'contactPhoneNumber' => Values::array_get($payload, 'contact_phone_number'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.DependentHostedNumberOrderInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderList.php new file mode 100644 index 0000000..86f6c60 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderList.php @@ -0,0 +1,164 @@ +solution = [ + 'signingDocumentSid' => + $signingDocumentSid, + + ]; + + $this->uri = '/HostedNumber/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) + .'/DependentHostedNumberOrders'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DependentHostedNumberOrderInstance 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 DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DependentHostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'PhoneNumber' => + $options['phoneNumber'], + 'IncomingPhoneNumberSid' => + $options['incomingPhoneNumberSid'], + 'FriendlyName' => + $options['friendlyName'], + '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 DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function getPage(string $targetUrl): DependentHostedNumberOrderPage + { + $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(): string + { + return '[Twilio.Numbers.V2.DependentHostedNumberOrderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderOptions.php new file mode 100644 index 0000000..537204e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderOptions.php @@ -0,0 +1,130 @@ +options['status'] = $status; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + return $this; + } + + /** + * A human readable description of this resource, up to 128 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 128 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadDependentHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderPage.php new file mode 100644 index 0000000..3a9ea96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DependentHostedNumberOrderInstance \Twilio\Rest\Numbers\V2\AuthorizationDocument\DependentHostedNumberOrderInstance + */ + public function buildInstance(array $payload): DependentHostedNumberOrderInstance + { + return new DependentHostedNumberOrderInstance($this->version, $payload, $this->solution['signingDocumentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.DependentHostedNumberOrderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php new file mode 100644 index 0000000..1ed3fe9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php @@ -0,0 +1,154 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/HostedNumber/AuthorizationDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AuthorizationDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthorizationDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentInstance.php new file mode 100644 index 0000000..36c714d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentInstance.php @@ -0,0 +1,155 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthorizationDocumentContext Context for this AuthorizationDocumentInstance + */ + protected function proxy(): AuthorizationDocumentContext + { + if (!$this->context) { + $this->context = new AuthorizationDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthorizationDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentList.php new file mode 100644 index 0000000..1f38ca2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentList.php @@ -0,0 +1,213 @@ +solution = [ + ]; + + $this->uri = '/HostedNumber/AuthorizationDocuments'; + } + + /** + * Create the AuthorizationDocumentInstance + * + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $addressSid, string $email, string $contactPhoneNumber, array $hostedNumberOrderSids, array $options = []): AuthorizationDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AddressSid' => + $addressSid, + 'Email' => + $email, + 'ContactPhoneNumber' => + $contactPhoneNumber, + 'HostedNumberOrderSids' => + Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), + 'ContactTitle' => + $options['contactTitle'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AuthorizationDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthorizationDocumentInstance 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 AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthorizationDocumentPage + { + $options = new Values($options); + + $params = Values::of([ + '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 AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function getPage(string $targetUrl): AuthorizationDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthorizationDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthorizationDocumentContext + * + * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. + */ + public function getContext( + string $sid + + ): AuthorizationDocumentContext + { + return new AuthorizationDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.AuthorizationDocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentOptions.php new file mode 100644 index 0000000..94b6caa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentOptions.php @@ -0,0 +1,168 @@ +options['contactTitle'] = $contactTitle; + $this->options['ccEmails'] = $ccEmails; + } + + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + * + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @return $this Fluent Builder + */ + public function setContactTitle(string $contactTitle): self + { + $this->options['contactTitle'] = $contactTitle; + return $this; + } + + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed. + * + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateAuthorizationDocumentOptions ' . $options . ']'; + } +} + + + +class ReadAuthorizationDocumentOptions extends Options + { + /** + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + */ + public function __construct( + + string $email = Values::NONE, + string $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 that this AuthorizationDocument will be sent to for signing. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadAuthorizationDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentPage.php new file mode 100644 index 0000000..9c54d5a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizationDocumentInstance \Twilio\Rest\Numbers\V2\AuthorizationDocumentInstance + */ + public function buildInstance(array $payload): AuthorizationDocumentInstance + { + return new AuthorizationDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.AuthorizationDocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php new file mode 100644 index 0000000..ea901a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php @@ -0,0 +1,92 @@ +solution = [ + 'bulkHostingSid' => + $bulkHostingSid, + ]; + + $this->uri = '/HostedNumber/Orders/Bulk/' . \rawurlencode($bulkHostingSid) + .''; + } + + /** + * Fetch the BulkHostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return BulkHostedNumberOrderInstance Fetched BulkHostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): BulkHostedNumberOrderInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'OrderStatus' => + $options['orderStatus'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new BulkHostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['bulkHostingSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BulkHostedNumberOrderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderInstance.php new file mode 100644 index 0000000..956d597 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'bulkHostingSid' => Values::array_get($payload, 'bulk_hosting_sid'), + 'requestStatus' => Values::array_get($payload, 'request_status'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'notificationEmail' => Values::array_get($payload, 'notification_email'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'url' => Values::array_get($payload, 'url'), + 'totalCount' => Values::array_get($payload, 'total_count'), + 'results' => Values::array_get($payload, 'results'), + ]; + + $this->solution = ['bulkHostingSid' => $bulkHostingSid ?: $this->properties['bulkHostingSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BulkHostedNumberOrderContext Context for this BulkHostedNumberOrderInstance + */ + protected function proxy(): BulkHostedNumberOrderContext + { + if (!$this->context) { + $this->context = new BulkHostedNumberOrderContext( + $this->version, + $this->solution['bulkHostingSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BulkHostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return BulkHostedNumberOrderInstance Fetched BulkHostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): BulkHostedNumberOrderInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BulkHostedNumberOrderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php new file mode 100644 index 0000000..72b19f3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php @@ -0,0 +1,90 @@ +solution = [ + ]; + + $this->uri = '/HostedNumber/Orders/Bulk'; + } + + /** + * Create the BulkHostedNumberOrderInstance + * + * @return BulkHostedNumberOrderInstance Created BulkHostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BulkHostedNumberOrderInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BulkHostedNumberOrderInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a BulkHostedNumberOrderContext + * + * @param string $bulkHostingSid A 34 character string that uniquely identifies this BulkHostedNumberOrder. + */ + public function getContext( + string $bulkHostingSid + + ): BulkHostedNumberOrderContext + { + return new BulkHostedNumberOrderContext( + $this->version, + $bulkHostingSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BulkHostedNumberOrderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php new file mode 100644 index 0000000..9b88e31 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php @@ -0,0 +1,78 @@ +options['orderStatus'] = $orderStatus; + } + + /** + * Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'. + * + * @param string $orderStatus Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'. + * @return $this Fluent Builder + */ + public function setOrderStatus(string $orderStatus): self + { + $this->options['orderStatus'] = $orderStatus; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.FetchBulkHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderPage.php new file mode 100644 index 0000000..4bd3aee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BulkHostedNumberOrderInstance \Twilio\Rest\Numbers\V2\BulkHostedNumberOrderInstance + */ + public function buildInstance(array $payload): BulkHostedNumberOrderInstance + { + return new BulkHostedNumberOrderInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BulkHostedNumberOrderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php new file mode 100644 index 0000000..e646e30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php @@ -0,0 +1,97 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/HostedNumber/Orders/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new HostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderInstance.php new file mode 100644 index 0000000..4fadfe0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderInstance.php @@ -0,0 +1,165 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'friendlyName' => Values::array_get($payload, 'friendly_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')), + 'email' => Values::array_get($payload, 'email'), + 'ccEmails' => Values::array_get($payload, 'cc_emails'), + 'url' => Values::array_get($payload, 'url'), + 'contactTitle' => Values::array_get($payload, 'contact_title'), + 'contactPhoneNumber' => Values::array_get($payload, 'contact_phone_number'), + 'bulkHostingRequestSid' => Values::array_get($payload, 'bulk_hosting_request_sid'), + 'nextStep' => Values::array_get($payload, 'next_step'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance + */ + protected function proxy(): HostedNumberOrderContext + { + if (!$this->context) { + $this->context = new HostedNumberOrderContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderList.php new file mode 100644 index 0000000..ae73cb8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderList.php @@ -0,0 +1,239 @@ +solution = [ + ]; + + $this->uri = '/HostedNumber/Orders'; + } + + /** + * Create the HostedNumberOrderInstance + * + * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + * @param string $email Optional. Email of the owner of this phone number that is being hosted. + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Created HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, string $contactPhoneNumber, string $addressSid, string $email, array $options = []): HostedNumberOrderInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ContactPhoneNumber' => + $contactPhoneNumber, + 'AddressSid' => + $addressSid, + 'Email' => + $email, + 'AccountSid' => + $options['accountSid'], + 'FriendlyName' => + $options['friendlyName'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsCapability' => + Serialize::booleanToString($options['smsCapability']), + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'ContactTitle' => + $options['contactTitle'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new HostedNumberOrderInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of HostedNumberOrderInstance 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 HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): HostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'SmsCapability' => + Serialize::booleanToString($options['smsCapability']), + 'PhoneNumber' => + $options['phoneNumber'], + 'IncomingPhoneNumberSid' => + $options['incomingPhoneNumberSid'], + 'FriendlyName' => + $options['friendlyName'], + '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 HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function getPage(string $targetUrl): HostedNumberOrderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new HostedNumberOrderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a HostedNumberOrderContext + * + * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. + */ + public function getContext( + string $sid + + ): HostedNumberOrderContext + { + return new HostedNumberOrderContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.HostedNumberOrderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderOptions.php new file mode 100644 index 0000000..d042431 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderOptions.php @@ -0,0 +1,402 @@ +options['accountSid'] = $accountSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['ccEmails'] = $ccEmails; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsCapability'] = $smsCapability; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['contactTitle'] = $contactTitle; + } + + /** + * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * + * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * A 128 character string that is a human readable text that describes this resource. + * + * @param string $friendlyName A 128 character string that is a human readable text that describes this resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. + * + * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * Used to specify that the SMS capability will be hosted on Twilio's platform. + * + * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. + * @return $this Fluent Builder + */ + public function setSmsCapability(bool $smsCapability): self + { + $this->options['smsCapability'] = $smsCapability; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $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 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. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + * + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @return $this Fluent Builder + */ + public function setContactTitle(string $contactTitle): self + { + $this->options['contactTitle'] = $contactTitle; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateHostedNumberOrderOptions ' . $options . ']'; + } +} + + + +class ReadHostedNumberOrderOptions extends Options + { + /** + * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @param bool $smsCapability Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @param string $friendlyName A human readable description of this resource, up to 128 characters. + */ + public function __construct( + + string $status = Values::NONE, + bool $smsCapability = Values::BOOL_NONE, + string $phoneNumber = Values::NONE, + string $incomingPhoneNumberSid = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['smsCapability'] = $smsCapability; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * 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. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. + * + * @param bool $smsCapability Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. + * @return $this Fluent Builder + */ + public function setSmsCapability(bool $smsCapability): self + { + $this->options['smsCapability'] = $smsCapability; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + return $this; + } + + /** + * A human readable description of this resource, up to 128 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 128 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderPage.php new file mode 100644 index 0000000..ba0c194 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return HostedNumberOrderInstance \Twilio\Rest\Numbers\V2\HostedNumberOrderInstance + */ + public function buildInstance(array $payload): HostedNumberOrderInstance + { + return new HostedNumberOrderInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.HostedNumberOrderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php new file mode 100644 index 0000000..87d2d7d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['bundleSid' => $bundleSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php new file mode 100644 index 0000000..7dcad98 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php @@ -0,0 +1,181 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Copies'; + } + + /** + * Create the BundleCopyInstance + * + * @param array|Options $options Optional Arguments + * @return BundleCopyInstance Created BundleCopyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): BundleCopyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BundleCopyInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads BundleCopyInstance 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 BundleCopyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BundleCopyInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BundleCopyInstance 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 BundleCopyPage Page of BundleCopyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BundleCopyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BundleCopyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BundleCopyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BundleCopyPage Page of BundleCopyInstance + */ + public function getPage(string $targetUrl): BundleCopyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BundleCopyPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php new file mode 100644 index 0000000..25b87de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php @@ -0,0 +1,78 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * The string that you assigned to describe the copied bundle. + * + * @param string $friendlyName The string that you assigned to describe the copied bundle. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateBundleCopyOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php new file mode 100644 index 0000000..757988b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BundleCopyInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\BundleCopyInstance + */ + public function buildInstance(array $payload): BundleCopyInstance + { + return new BundleCopyInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php new file mode 100644 index 0000000..4dd58bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php @@ -0,0 +1,89 @@ +solution = [ + 'bundleSid' => + $bundleSid, + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EvaluationInstance + * + * @return EvaluationInstance Fetched EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EvaluationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EvaluationInstance( + $this->version, + $payload, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EvaluationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php new file mode 100644 index 0000000..5999c7e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EvaluationContext Context for this EvaluationInstance + */ + protected function proxy(): EvaluationContext + { + if (!$this->context) { + $this->context = new EvaluationContext( + $this->version, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EvaluationInstance + * + * @return EvaluationInstance Fetched EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EvaluationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EvaluationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php new file mode 100644 index 0000000..b0855d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php @@ -0,0 +1,189 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Evaluations'; + } + + /** + * Create the EvaluationInstance + * + * @return EvaluationInstance Created EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): EvaluationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new EvaluationInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads EvaluationInstance 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 EvaluationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EvaluationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EvaluationInstance 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 EvaluationPage Page of EvaluationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EvaluationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EvaluationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EvaluationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EvaluationPage Page of EvaluationInstance + */ + public function getPage(string $targetUrl): EvaluationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EvaluationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EvaluationContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): EvaluationContext + { + return new EvaluationContext( + $this->version, + $this->solution['bundleSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EvaluationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php new file mode 100644 index 0000000..d6dac4c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EvaluationInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\EvaluationInstance + */ + public function buildInstance(array $payload): EvaluationInstance + { + return new EvaluationInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EvaluationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php new file mode 100644 index 0000000..b39915c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php @@ -0,0 +1,103 @@ +solution = [ + 'bundleSid' => + $bundleSid, + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ItemAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ItemAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ItemAssignmentInstance + * + * @return ItemAssignmentInstance Fetched ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ItemAssignmentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ItemAssignmentInstance( + $this->version, + $payload, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.ItemAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php new file mode 100644 index 0000000..716de08 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ItemAssignmentContext Context for this ItemAssignmentInstance + */ + protected function proxy(): ItemAssignmentContext + { + if (!$this->context) { + $this->context = new ItemAssignmentContext( + $this->version, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ItemAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ItemAssignmentInstance + * + * @return ItemAssignmentInstance Fetched ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ItemAssignmentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.ItemAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php new file mode 100644 index 0000000..5eca914 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php @@ -0,0 +1,195 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ItemAssignments'; + } + + /** + * Create the ItemAssignmentInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return ItemAssignmentInstance Created ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): ItemAssignmentInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ItemAssignmentInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads ItemAssignmentInstance 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 ItemAssignmentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ItemAssignmentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ItemAssignmentInstance 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 ItemAssignmentPage Page of ItemAssignmentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ItemAssignmentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ItemAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ItemAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ItemAssignmentPage Page of ItemAssignmentInstance + */ + public function getPage(string $targetUrl): ItemAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ItemAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ItemAssignmentContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): ItemAssignmentContext + { + return new ItemAssignmentContext( + $this->version, + $this->solution['bundleSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ItemAssignmentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php new file mode 100644 index 0000000..ee8b85f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ItemAssignmentInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ItemAssignmentInstance + */ + public function buildInstance(array $payload): ItemAssignmentInstance + { + return new ItemAssignmentInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ItemAssignmentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php new file mode 100644 index 0000000..e6926a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['bundleSid' => $bundleSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php new file mode 100644 index 0000000..4071243 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php @@ -0,0 +1,85 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ReplaceItems'; + } + + /** + * Create the ReplaceItemsInstance + * + * @param string $fromBundleSid The source bundle sid to copy the item assignments from. + * @return ReplaceItemsInstance Created ReplaceItemsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $fromBundleSid): ReplaceItemsInstance + { + + $data = Values::of([ + 'FromBundleSid' => + $fromBundleSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ReplaceItemsInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php new file mode 100644 index 0000000..ac13810 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReplaceItemsInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ReplaceItemsInstance + */ + public function buildInstance(array $payload): ReplaceItemsInstance + { + return new ReplaceItemsInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php new file mode 100644 index 0000000..49c370c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php @@ -0,0 +1,245 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BundleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BundleInstance + * + * @return BundleInstance Fetched BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BundleInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BundleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the BundleInstance + * + * @param array|Options $options Optional Arguments + * @return BundleInstance Updated BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BundleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new BundleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the replaceItems + */ + protected function getReplaceItems(): ReplaceItemsList + { + if (!$this->_replaceItems) { + $this->_replaceItems = new ReplaceItemsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_replaceItems; + } + + /** + * Access the evaluations + */ + protected function getEvaluations(): EvaluationList + { + if (!$this->_evaluations) { + $this->_evaluations = new EvaluationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_evaluations; + } + + /** + * Access the bundleCopies + */ + protected function getBundleCopies(): BundleCopyList + { + if (!$this->_bundleCopies) { + $this->_bundleCopies = new BundleCopyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bundleCopies; + } + + /** + * Access the itemAssignments + */ + protected function getItemAssignments(): ItemAssignmentList + { + if (!$this->_itemAssignments) { + $this->_itemAssignments = new ItemAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_itemAssignments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BundleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php new file mode 100644 index 0000000..fb940bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php @@ -0,0 +1,205 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BundleContext Context for this BundleInstance + */ + protected function proxy(): BundleContext + { + if (!$this->context) { + $this->context = new BundleContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BundleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BundleInstance + * + * @return BundleInstance Fetched BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BundleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BundleInstance + * + * @param array|Options $options Optional Arguments + * @return BundleInstance Updated BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BundleInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the replaceItems + */ + protected function getReplaceItems(): ReplaceItemsList + { + return $this->proxy()->replaceItems; + } + + /** + * Access the evaluations + */ + protected function getEvaluations(): EvaluationList + { + return $this->proxy()->evaluations; + } + + /** + * Access the bundleCopies + */ + protected function getBundleCopies(): BundleCopyList + { + return $this->proxy()->bundleCopies; + } + + /** + * Access the itemAssignments + */ + protected function getItemAssignments(): ItemAssignmentList + { + return $this->proxy()->itemAssignments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BundleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php new file mode 100644 index 0000000..48f0237 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php @@ -0,0 +1,231 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/Bundles'; + } + + /** + * Create the BundleInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @param array|Options $options Optional Arguments + * @return BundleInstance Created BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, array $options = []): BundleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'StatusCallback' => + $options['statusCallback'], + 'RegulationSid' => + $options['regulationSid'], + 'IsoCountry' => + $options['isoCountry'], + 'EndUserType' => + $options['endUserType'], + 'NumberType' => + $options['numberType'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BundleInstance( + $this->version, + $payload + ); + } + + + /** + * Reads BundleInstance 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 BundleInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BundleInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BundleInstance 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 BundlePage Page of BundleInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BundlePage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'RegulationSid' => + $options['regulationSid'], + 'IsoCountry' => + $options['isoCountry'], + 'NumberType' => + $options['numberType'], + 'HasValidUntilDate' => + Serialize::booleanToString($options['hasValidUntilDate']), + 'SortBy' => + $options['sortBy'], + 'SortDirection' => + $options['sortDirection'], + 'ValidUntilDate<' => + Serialize::iso8601DateTime($options['validUntilDateBefore']), + 'ValidUntilDate' => + Serialize::iso8601DateTime($options['validUntilDate']), + 'ValidUntilDate>' => + Serialize::iso8601DateTime($options['validUntilDateAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BundlePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BundleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BundlePage Page of BundleInstance + */ + public function getPage(string $targetUrl): BundlePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BundlePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BundleContext + * + * @param string $sid The unique string that we created to identify the Bundle resource. + */ + public function getContext( + string $sid + + ): BundleContext + { + return new BundleContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php new file mode 100644 index 0000000..18deba0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php @@ -0,0 +1,486 @@ +=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return ReadBundleOptions Options builder + */ + public static function read( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $numberType = Values::NONE, + bool $hasValidUntilDate = Values::BOOL_NONE, + string $sortBy = Values::NONE, + string $sortDirection = Values::NONE, + string $validUntilDateBefore = null, + string $validUntilDate = null, + string $validUntilDateAfter = null + + ): ReadBundleOptions + { + return new ReadBundleOptions( + $status, + $friendlyName, + $regulationSid, + $isoCountry, + $numberType, + $hasValidUntilDate, + $sortBy, + $sortDirection, + $validUntilDateBefore, + $validUntilDate, + $validUntilDateAfter + ); + } + + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @return UpdateBundleOptions Options builder + */ + public static function update( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ): UpdateBundleOptions + { + return new UpdateBundleOptions( + $status, + $statusCallback, + $friendlyName, + $email + ); + } + +} + +class CreateBundleOptions extends Options + { + /** + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @param string $endUserType + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + */ + public function __construct( + + string $statusCallback = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $endUserType = Values::NONE, + string $numberType = Values::NONE + + ) { + $this->options['statusCallback'] = $statusCallback; + $this->options['regulationSid'] = $regulationSid; + $this->options['isoCountry'] = $isoCountry; + $this->options['endUserType'] = $endUserType; + $this->options['numberType'] = $numberType; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The unique string of a regulation that is associated to the Bundle resource. + * + * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. + * @return $this Fluent Builder + */ + public function setRegulationSid(string $regulationSid): self + { + $this->options['regulationSid'] = $regulationSid; + return $this; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * @param string $endUserType + * @return $this Fluent Builder + */ + public function setEndUserType(string $endUserType): self + { + $this->options['endUserType'] = $endUserType; + return $this; + } + + /** + * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + * + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateBundleOptions ' . $options . ']'; + } +} + + + +class ReadBundleOptions extends Options + { + /** + * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. + * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. + * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. + * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $numberType = Values::NONE, + bool $hasValidUntilDate = Values::BOOL_NONE, + string $sortBy = Values::NONE, + string $sortDirection = Values::NONE, + string $validUntilDateBefore = null, + string $validUntilDate = null, + string $validUntilDateAfter = null + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['regulationSid'] = $regulationSid; + $this->options['isoCountry'] = $isoCountry; + $this->options['numberType'] = $numberType; + $this->options['hasValidUntilDate'] = $hasValidUntilDate; + $this->options['sortBy'] = $sortBy; + $this->options['sortDirection'] = $sortDirection; + $this->options['validUntilDateBefore'] = $validUntilDateBefore; + $this->options['validUntilDate'] = $validUntilDate; + $this->options['validUntilDateAfter'] = $validUntilDateAfter; + } + + /** + * The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * + * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. The column can contain 255 variable characters. + * + * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * + * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * @return $this Fluent Builder + */ + public function setRegulationSid(string $regulationSid): self + { + $this->options['regulationSid'] = $regulationSid; + return $this; + } + + /** + * The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * + * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * Indicates that the Bundle is a valid Bundle until a specified expiration date. + * + * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. + * @return $this Fluent Builder + */ + public function setHasValidUntilDate(bool $hasValidUntilDate): self + { + $this->options['hasValidUntilDate'] = $hasValidUntilDate; + return $this; + } + + /** + * Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * + * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * @return $this Fluent Builder + */ + public function setSortBy(string $sortBy): self + { + $this->options['sortBy'] = $sortBy; + return $this; + } + + /** + * Default is `DESC`. Can be `ASC` or `DESC`. + * + * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. + * @return $this Fluent Builder + */ + public function setSortDirection(string $sortDirection): self + { + $this->options['sortDirection'] = $sortDirection; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDateBefore(string $validUntilDateBefore): self + { + $this->options['validUntilDateBefore'] = $validUntilDateBefore; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDate(string $validUntilDate): self + { + $this->options['validUntilDate'] = $validUntilDate; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDateAfter(string $validUntilDateAfter): self + { + $this->options['validUntilDateAfter'] = $validUntilDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadBundleOptions ' . $options . ']'; + } +} + +class UpdateBundleOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Bundle resource changes status. + * + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateBundleOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php new file mode 100644 index 0000000..2327e1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BundleInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\BundleInstance + */ + public function buildInstance(array $payload): BundleInstance + { + return new BundleInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundlePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php new file mode 100644 index 0000000..f331f04 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php @@ -0,0 +1,129 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/EndUsers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php new file mode 100644 index 0000000..0624254 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserContext Context for this EndUserInstance + */ + protected function proxy(): EndUserContext + { + if (!$this->context) { + $this->context = new EndUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php new file mode 100644 index 0000000..df3671e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/EndUsers'; + } + + /** + * Create the EndUserInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type + * @param array|Options $options Optional Arguments + * @return EndUserInstance Created EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EndUserInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EndUserInstance 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 EndUserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserInstance 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 EndUserPage Page of EndUserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserPage Page of EndUserInstance + */ + public function getPage(string $targetUrl): EndUserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserContext + * + * @param string $sid The unique string created by Twilio to identify the End User resource. + */ + public function getContext( + string $sid + + ): EndUserContext + { + return new EndUserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php new file mode 100644 index 0000000..c6577e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateEndUserOptions ' . $options . ']'; + } +} + + + + +class UpdateEndUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateEndUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php new file mode 100644 index 0000000..b39ec28 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserInstance + */ + public function buildInstance(array $payload): EndUserInstance + { + return new EndUserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php new file mode 100644 index 0000000..4207e33 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/EndUserTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EndUserTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php new file mode 100644 index 0000000..3dbf04e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserTypeContext Context for this EndUserTypeInstance + */ + protected function proxy(): EndUserTypeContext + { + if (!$this->context) { + $this->context = new EndUserTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php new file mode 100644 index 0000000..7c0ef38 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/EndUserTypes'; + } + + /** + * Reads EndUserTypeInstance 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 EndUserTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserTypeInstance 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 EndUserTypePage Page of EndUserTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function getPage(string $targetUrl): EndUserTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserTypeContext + * + * @param string $sid The unique string that identifies the End-User Type resource. + */ + public function getContext( + string $sid + + ): EndUserTypeContext + { + return new EndUserTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php new file mode 100644 index 0000000..507b86d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserTypeInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserTypeInstance + */ + public function buildInstance(array $payload): EndUserTypeInstance + { + return new EndUserTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php new file mode 100644 index 0000000..e01cd0b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php @@ -0,0 +1,93 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Regulations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the RegulationInstance + * + * @param array|Options $options Optional Arguments + * @return RegulationInstance Fetched RegulationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RegulationInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'IncludeConstraints' => + Serialize::booleanToString($options['includeConstraints']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new RegulationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.RegulationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php new file mode 100644 index 0000000..c66c997 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'numberType' => Values::array_get($payload, 'number_type'), + 'endUserType' => Values::array_get($payload, 'end_user_type'), + 'requirements' => Values::array_get($payload, 'requirements'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RegulationContext Context for this RegulationInstance + */ + protected function proxy(): RegulationContext + { + if (!$this->context) { + $this->context = new RegulationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RegulationInstance + * + * @param array|Options $options Optional Arguments + * @return RegulationInstance Fetched RegulationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RegulationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.RegulationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php new file mode 100644 index 0000000..2f35b1b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php @@ -0,0 +1,175 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/Regulations'; + } + + /** + * Reads RegulationInstance 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 RegulationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RegulationInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RegulationInstance 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 RegulationPage Page of RegulationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RegulationPage + { + $options = new Values($options); + + $params = Values::of([ + 'EndUserType' => + $options['endUserType'], + 'IsoCountry' => + $options['isoCountry'], + 'NumberType' => + $options['numberType'], + 'IncludeConstraints' => + Serialize::booleanToString($options['includeConstraints']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RegulationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RegulationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RegulationPage Page of RegulationInstance + */ + public function getPage(string $targetUrl): RegulationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RegulationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RegulationContext + * + * @param string $sid The unique string that identifies the Regulation resource. + */ + public function getContext( + string $sid + + ): RegulationContext + { + return new RegulationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php new file mode 100644 index 0000000..ff2a610 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php @@ -0,0 +1,182 @@ +options['includeConstraints'] = $includeConstraints; + } + + /** + * A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields + * + * @param bool $includeConstraints A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields + * @return $this Fluent Builder + */ + public function setIncludeConstraints(bool $includeConstraints): self + { + $this->options['includeConstraints'] = $includeConstraints; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.FetchRegulationOptions ' . $options . ']'; + } +} + +class ReadRegulationOptions extends Options + { + /** + * @param string $endUserType The type of End User the regulation requires - can be `individual` or `business`. + * @param string $isoCountry The ISO country code of the phone number's country. + * @param string $numberType The type of phone number that the regulatory requiremnt is restricting. + * @param bool $includeConstraints A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields + */ + public function __construct( + + string $endUserType = Values::NONE, + string $isoCountry = Values::NONE, + string $numberType = Values::NONE, + bool $includeConstraints = Values::BOOL_NONE + + ) { + $this->options['endUserType'] = $endUserType; + $this->options['isoCountry'] = $isoCountry; + $this->options['numberType'] = $numberType; + $this->options['includeConstraints'] = $includeConstraints; + } + + /** + * The type of End User the regulation requires - can be `individual` or `business`. + * + * @param string $endUserType The type of End User the regulation requires - can be `individual` or `business`. + * @return $this Fluent Builder + */ + public function setEndUserType(string $endUserType): self + { + $this->options['endUserType'] = $endUserType; + return $this; + } + + /** + * The ISO country code of the phone number's country. + * + * @param string $isoCountry The ISO country code of the phone number's country. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The type of phone number that the regulatory requiremnt is restricting. + * + * @param string $numberType The type of phone number that the regulatory requiremnt is restricting. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields + * + * @param bool $includeConstraints A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields + * @return $this Fluent Builder + */ + public function setIncludeConstraints(bool $includeConstraints): self + { + $this->options['includeConstraints'] = $includeConstraints; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadRegulationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php new file mode 100644 index 0000000..4096482 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RegulationInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\RegulationInstance + */ + public function buildInstance(array $payload): RegulationInstance + { + return new RegulationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php new file mode 100644 index 0000000..616ccb6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php @@ -0,0 +1,129 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php new file mode 100644 index 0000000..61d4e4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'mimeType' => Values::array_get($payload, 'mime_type'), + 'status' => Values::array_get($payload, 'status'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentContext Context for this SupportingDocumentInstance + */ + protected function proxy(): SupportingDocumentContext + { + if (!$this->context) { + $this->context = new SupportingDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php new file mode 100644 index 0000000..32371a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocuments'; + } + + /** + * Create the SupportingDocumentInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of the Supporting Document. + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Created SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SupportingDocumentInstance 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 SupportingDocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentInstance 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 SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function getPage(string $targetUrl): SupportingDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentContext + * + * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentContext + { + return new SupportingDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php new file mode 100644 index 0000000..cdd8c02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateSupportingDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateSupportingDocumentOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateSupportingDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php new file mode 100644 index 0000000..649f480 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentInstance + */ + public function buildInstance(array $payload): SupportingDocumentInstance + { + return new SupportingDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php new file mode 100644 index 0000000..ae25778 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SupportingDocumentTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php new file mode 100644 index 0000000..a38b80a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance + */ + protected function proxy(): SupportingDocumentTypeContext + { + if (!$this->context) { + $this->context = new SupportingDocumentTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php new file mode 100644 index 0000000..60fc453 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes'; + } + + /** + * Reads SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentTypeInstance 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 SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function getPage(string $targetUrl): SupportingDocumentTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentTypeContext + * + * @param string $sid The unique string that identifies the Supporting Document Type resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentTypeContext + { + return new SupportingDocumentTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php new file mode 100644 index 0000000..7f52d8a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentTypeInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentTypeInstance + */ + public function buildInstance(array $payload): SupportingDocumentTypeInstance + { + return new SupportingDocumentTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php new file mode 100644 index 0000000..5d25126 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulatoryComplianceInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php new file mode 100644 index 0000000..4141c39 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php @@ -0,0 +1,191 @@ +solution = [ + ]; + } + + /** + * Access the regulations + */ + protected function getRegulations(): RegulationList + { + if (!$this->_regulations) { + $this->_regulations = new RegulationList( + $this->version + ); + } + return $this->_regulations; + } + + /** + * Access the supportingDocuments + */ + protected function getSupportingDocuments(): SupportingDocumentList + { + if (!$this->_supportingDocuments) { + $this->_supportingDocuments = new SupportingDocumentList( + $this->version + ); + } + return $this->_supportingDocuments; + } + + /** + * Access the bundles + */ + protected function getBundles(): BundleList + { + if (!$this->_bundles) { + $this->_bundles = new BundleList( + $this->version + ); + } + return $this->_bundles; + } + + /** + * Access the endUserTypes + */ + protected function getEndUserTypes(): EndUserTypeList + { + if (!$this->_endUserTypes) { + $this->_endUserTypes = new EndUserTypeList( + $this->version + ); + } + return $this->_endUserTypes; + } + + /** + * Access the endUsers + */ + protected function getEndUsers(): EndUserList + { + if (!$this->_endUsers) { + $this->_endUsers = new EndUserList( + $this->version + ); + } + return $this->_endUsers; + } + + /** + * Access the supportingDocumentTypes + */ + protected function getSupportingDocumentTypes(): SupportingDocumentTypeList + { + if (!$this->_supportingDocumentTypes) { + $this->_supportingDocumentTypes = new SupportingDocumentTypeList( + $this->version + ); + } + return $this->_supportingDocumentTypes; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Numbers.V2.RegulatoryComplianceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php new file mode 100644 index 0000000..4f7be78 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RegulatoryComplianceInstance \Twilio\Rest\Numbers\V2\RegulatoryComplianceInstance + */ + public function buildInstance(array $payload): RegulatoryComplianceInstance + { + return new RegulatoryComplianceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulatoryCompliancePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/NumbersBase.php b/vendor/twilio/sdk/src/Twilio/Rest/NumbersBase.php new file mode 100644 index 0000000..a1d9c9f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/NumbersBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://numbers.twilio.com'; + } + + + /** + * @return V1 Version v1 of numbers + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of numbers + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Numbers]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth.php new file mode 100644 index 0000000..ec90d8d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth.php @@ -0,0 +1,71 @@ +oauth instead. + */ + protected function getOauth(): \Twilio\Rest\Oauth\V1\OauthList { + echo "oauth is deprecated. Use v1->oauth instead."; + return $this->v1->oauth; + } + + /** + * @deprecated Use v1->oauth() instead. + */ + protected function contextOauth(): \Twilio\Rest\Oauth\V1\OauthContext { + echo "oauth() is deprecated. Use v1->oauth() instead."; + return $this->v1->oauth(); + } + + /** + * @deprecated Use v1->deviceCode instead. + */ + protected function getDeviceCode(): \Twilio\Rest\Oauth\V1\DeviceCodeList { + echo "deviceCode is deprecated. Use v1->deviceCode instead."; + return $this->v1->deviceCode; + } + + /** + * @deprecated Use v1->openidDiscovery instead. + */ + protected function getOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryList { + echo "openidDiscovery is deprecated. Use v1->openidDiscovery instead."; + return $this->v1->openidDiscovery; + } + + /** + * @deprecated Use v1->openidDiscovery() instead. + */ + protected function contextOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryContext { + echo "openidDiscovery() is deprecated. Use v1->openidDiscovery() instead."; + return $this->v1->openidDiscovery(); + } + + /** + * @deprecated Use v1->token instead. + */ + protected function getToken(): \Twilio\Rest\Oauth\V1\TokenList { + echo "token is deprecated. Use v1->token instead."; + return $this->v1->token; + } + + /** + * @deprecated Use v1->userInfo instead. + */ + protected function getUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoList { + echo "userInfo is deprecated. Use v1->userInfo instead."; + return $this->v1->userInfo; + } + + /** + * @deprecated Use v1->userInfo() instead. + */ + protected function contextUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoContext { + echo "userInfo() is deprecated. Use v1->userInfo() instead."; + return $this->v1->userInfo(); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1.php new file mode 100644 index 0000000..2885d7f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1.php @@ -0,0 +1,105 @@ +version = 'v1'; + } + + protected function getAuthorize(): AuthorizeList + { + if (!$this->_authorize) { + $this->_authorize = new AuthorizeList($this); + } + return $this->_authorize; + } + + protected function getToken(): TokenList + { + if (!$this->_token) { + $this->_token = new TokenList($this); + } + return $this->_token; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Oauth.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php new file mode 100644 index 0000000..8e586e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.AuthorizeInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeList.php new file mode 100644 index 0000000..5af8b56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeList.php @@ -0,0 +1,89 @@ +solution = [ + ]; + + $this->uri = '/authorize'; + } + + /** + * Fetch the AuthorizeInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizeInstance Fetched AuthorizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): AuthorizeInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'ResponseType' => + $options['responseType'], + 'ClientId' => + $options['clientId'], + 'RedirectUri' => + $options['redirectUri'], + 'Scope' => + $options['scope'], + 'State' => + $options['state'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new AuthorizeInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.AuthorizeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php new file mode 100644 index 0000000..aedc514 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php @@ -0,0 +1,148 @@ +options['responseType'] = $responseType; + $this->options['clientId'] = $clientId; + $this->options['redirectUri'] = $redirectUri; + $this->options['scope'] = $scope; + $this->options['state'] = $state; + } + + /** + * Response Type + * + * @param string $responseType Response Type + * @return $this Fluent Builder + */ + public function setResponseType(string $responseType): self + { + $this->options['responseType'] = $responseType; + return $this; + } + + /** + * The Client Identifier + * + * @param string $clientId The Client Identifier + * @return $this Fluent Builder + */ + public function setClientId(string $clientId): self + { + $this->options['clientId'] = $clientId; + return $this; + } + + /** + * The url to which response will be redirected to + * + * @param string $redirectUri The url to which response will be redirected to + * @return $this Fluent Builder + */ + public function setRedirectUri(string $redirectUri): self + { + $this->options['redirectUri'] = $redirectUri; + return $this; + } + + /** + * The scope of the access request + * + * @param string $scope The scope of the access request + * @return $this Fluent Builder + */ + public function setScope(string $scope): self + { + $this->options['scope'] = $scope; + return $this; + } + + /** + * An opaque value which can be used to maintain state between the request and callback + * + * @param string $state An opaque value which can be used to maintain state between the request and callback + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.FetchAuthorizeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizePage.php new file mode 100644 index 0000000..5eb9be2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/AuthorizePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizeInstance \Twilio\Rest\Oauth\V1\AuthorizeInstance + */ + public function buildInstance(array $payload): AuthorizeInstance + { + return new AuthorizeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.AuthorizePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenInstance.php new file mode 100644 index 0000000..8438178 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'accessToken' => Values::array_get($payload, 'access_token'), + 'refreshToken' => Values::array_get($payload, 'refresh_token'), + 'idToken' => Values::array_get($payload, 'id_token'), + 'tokenType' => Values::array_get($payload, 'token_type'), + 'expiresIn' => Values::array_get($payload, 'expires_in'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenList.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenList.php new file mode 100644 index 0000000..1994763 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenList.php @@ -0,0 +1,97 @@ +solution = [ + ]; + + $this->uri = '/token'; + } + + /** + * Create the TokenInstance + * + * @param string $grantType Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + * @param string $clientId A 34 character string that uniquely identifies this OAuth App. + * @param array|Options $options Optional Arguments + * @return TokenInstance Created TokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $grantType, string $clientId, array $options = []): TokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'GrantType' => + $grantType, + 'ClientId' => + $clientId, + 'ClientSecret' => + $options['clientSecret'], + 'Code' => + $options['code'], + 'RedirectUri' => + $options['redirectUri'], + 'Audience' => + $options['audience'], + 'RefreshToken' => + $options['refreshToken'], + 'Scope' => + $options['scope'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TokenInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenOptions.php new file mode 100644 index 0000000..6db0240 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenOptions.php @@ -0,0 +1,166 @@ +options['clientSecret'] = $clientSecret; + $this->options['code'] = $code; + $this->options['redirectUri'] = $redirectUri; + $this->options['audience'] = $audience; + $this->options['refreshToken'] = $refreshToken; + $this->options['scope'] = $scope; + } + + /** + * The credential for confidential OAuth App. + * + * @param string $clientSecret The credential for confidential OAuth App. + * @return $this Fluent Builder + */ + public function setClientSecret(string $clientSecret): self + { + $this->options['clientSecret'] = $clientSecret; + return $this; + } + + /** + * JWT token related to the authorization code grant type. + * + * @param string $code JWT token related to the authorization code grant type. + * @return $this Fluent Builder + */ + public function setCode(string $code): self + { + $this->options['code'] = $code; + return $this; + } + + /** + * The redirect uri + * + * @param string $redirectUri The redirect uri + * @return $this Fluent Builder + */ + public function setRedirectUri(string $redirectUri): self + { + $this->options['redirectUri'] = $redirectUri; + return $this; + } + + /** + * The targeted audience uri + * + * @param string $audience The targeted audience uri + * @return $this Fluent Builder + */ + public function setAudience(string $audience): self + { + $this->options['audience'] = $audience; + return $this; + } + + /** + * JWT token related to refresh access token. + * + * @param string $refreshToken JWT token related to refresh access token. + * @return $this Fluent Builder + */ + public function setRefreshToken(string $refreshToken): self + { + $this->options['refreshToken'] = $refreshToken; + return $this; + } + + /** + * The scope of token + * + * @param string $scope The scope of token + * @return $this Fluent Builder + */ + public function setScope(string $scope): self + { + $this->options['scope'] = $scope; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.CreateTokenOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenPage.php new file mode 100644 index 0000000..53ebc5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Oauth/V1/TokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TokenInstance \Twilio\Rest\Oauth\V1\TokenInstance + */ + public function buildInstance(array $payload): TokenInstance + { + return new TokenInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/OauthBase.php b/vendor/twilio/sdk/src/Twilio/Rest/OauthBase.php new file mode 100644 index 0000000..f056693 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/OauthBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://oauth.twilio.com'; + } + + + /** + * @return V1 Version v1 of oauth + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Oauth]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview.php new file mode 100644 index 0000000..1a79db1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview.php @@ -0,0 +1,178 @@ +fleets instead. + */ + protected function getFleets(): \Twilio\Rest\Preview\DeployedDevices\FleetList { + echo "fleets is deprecated. Use deployedDevices->fleets instead."; + return $this->deployedDevices->fleets; + } + + /** + * @deprecated Use deployedDevices->fleets(\$sid) instead. + * @param string $sid A string that uniquely identifies the Fleet. + */ + protected function contextFleets(string $sid): \Twilio\Rest\Preview\DeployedDevices\FleetContext { + echo "fleets(\$sid) is deprecated. Use deployedDevices->fleets(\$sid) instead."; + return $this->deployedDevices->fleets($sid); + } + + /** + * @deprecated Use hostedNumbers->authorizationDocuments instead. + */ + protected function getAuthorizationDocuments(): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList { + echo "authorizationDocuments is deprecated. Use hostedNumbers->authorizationDocuments instead."; + return $this->hostedNumbers->authorizationDocuments; + } + + /** + * @deprecated Use hostedNumbers->authorizationDocuments(\$sid) instead. + * @param string $sid AuthorizationDocument sid. + */ + protected function contextAuthorizationDocuments(string $sid): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext { + echo "authorizationDocuments(\$sid) is deprecated. Use hostedNumbers->authorizationDocuments(\$sid) instead."; + return $this->hostedNumbers->authorizationDocuments($sid); + } + + /** + * @deprecated Use hostedNumbers->hostedNumberOrders instead. + */ + protected function getHostedNumberOrders(): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList { + echo "hostedNumberOrders is deprecated. Use hostedNumbers->hostedNumberOrders instead."; + return $this->hostedNumbers->hostedNumberOrders; + } + + /** + * @deprecated Use hostedNumbers->hostedNumberOrders(\$sid) instead + * @param string $sid HostedNumberOrder sid. + */ + protected function contextHostedNumberOrders(string $sid): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext { + echo "hostedNumberOrders(\$sid) is deprecated. Use hostedNumbers->hostedNumberOrders(\$sid) instead."; + return $this->hostedNumbers->hostedNumberOrders($sid); + } + + /** + * @deprecated Use marketplace->availableAddOns instead. + */ + protected function getAvailableAddOns(): \Twilio\Rest\Preview\Marketplace\AvailableAddOnList { + echo "availableAddOns is deprecated. Use marketplace->availableAddOns instead."; + return $this->marketplace->availableAddOns; + } + + /** + * @deprecated Use marketplace->availableAddOns(\$sid) instead. + * @param string $sid The SID of the AvailableAddOn resource to fetch + */ + protected function contextAvailableAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext { + echo "availableAddOns(\$sid) is deprecated. Use marketplace->availableAddOns(\$sid) instead."; + return $this->marketplace->availableAddOns($sid); + } + + /** + * @deprecated Use marketplace->installedAddOns instead. + */ + protected function getInstalledAddOns(): \Twilio\Rest\Preview\Marketplace\InstalledAddOnList { + echo "installedAddOns is deprecated. Use marketplace->installedAddOns instead."; + return $this->marketplace->installedAddOns; + } + + /** + * @deprecated Use marketplace->installedAddOns(\$sid) instead. + * @param string $sid The SID of the InstalledAddOn resource to fetch + */ + protected function contextInstalledAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext { + echo "installedAddOns(\$sid) is deprecated. Use marketplace->installedAddOns(\$sid) instead."; + return $this->marketplace->installedAddOns($sid); + } + + /** + * @deprecated Use sync->services instead. + */ + protected function getServices(): \Twilio\Rest\Preview\Sync\ServiceList { + echo "services is deprecated. Use sync->services instead."; + return $this->sync->services; + } + + /** + * @deprecated Use sync->services(\$sid) instead. + * @param string $sid The sid + */ + protected function contextServices(string $sid): \Twilio\Rest\Preview\Sync\ServiceContext { + echo "services(\$sid) is deprecated. Use sync->services(\$sid) instead."; + return $this->sync->services($sid); + } + + /** + * @deprecated Use understand->assistants instead. + */ + protected function getAssistants(): \Twilio\Rest\Preview\Understand\AssistantList { + echo "assistants is deprecated. Use understand->assistants instead."; + return $this->understand->assistants; + } + + /** + * @deprecated Use understand->assistants(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextAssistants(string $sid): \Twilio\Rest\Preview\Understand\AssistantContext { + echo "assistants(\$sid) is deprecated. Use understand->assistants(\$sid) instead."; + return $this->understand->assistants($sid); + } + + /** + * @deprecated Use wireless->commands instead. + */ + protected function getCommands(): \Twilio\Rest\Preview\Wireless\CommandList { + echo "commands is deprecated. Use wireless->commands instead."; + return $this->wireless->commands; + } + + /** + * @deprecated Use wireless->commands(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCommands(string $sid): \Twilio\Rest\Preview\Wireless\CommandContext { + echo "commands(\$sid) is deprecated. Use wireless->commands(\$sid) instead."; + return $this->wireless->commands($sid); + } + + /** + * @deprecated Use wireless->ratePlans instead. + */ + protected function getRatePlans(): \Twilio\Rest\Preview\Wireless\RatePlanList { + echo "ratePlans is deprecated. Use wireless->ratePlans instead."; + return $this->wireless->ratePlans; + } + + /** + * @deprecated Use wireless->ratePlans(\$sid) instead. + * @param string $sid The sid + */ + protected function contextRatePlans(string $sid): \Twilio\Rest\Preview\Wireless\RatePlanContext { + echo "ratePlans(\$sid) is deprecated. Use wireless->ratePlans(\$sid) instead."; + return $this->wireless->ratePlans($sid); + } + + /** + * @deprecated Use wireless->sims instead. + */ + protected function getSims(): \Twilio\Rest\Preview\Wireless\SimList { + echo "sims is deprecated. Use wireless->sims instead."; + return $this->wireless->sims; + } + + /** + * @deprecated Use wireless->sims(\$sid) instead. + * @param string $sid The sid + */ + protected function contextSims(string $sid): \Twilio\Rest\Preview\Wireless\SimContext { + echo "sims(\$sid) is deprecated. Use wireless->sims(\$sid) instead."; + return $this->wireless->sims($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices.php new file mode 100644 index 0000000..2be4c28 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices.php @@ -0,0 +1,95 @@ +version = 'DeployedDevices'; + } + + protected function getFleets(): FleetList + { + if (!$this->_fleets) { + $this->_fleets = new FleetList($this); + } + return $this->_fleets; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Preview.DeployedDevices]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php new file mode 100644 index 0000000..ba756de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php @@ -0,0 +1,135 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Certificates/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CertificateInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CertificateInstance + * + * @return CertificateInstance Fetched CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CertificateInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CertificateInstance + * + * @param array|Options $options Optional Arguments + * @return CertificateInstance Updated CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CertificateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.CertificateContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php new file mode 100644 index 0000000..985d70a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 CertificateContext Context for this CertificateInstance + */ + protected function proxy(): CertificateContext + { + if (!$this->context) { + $this->context = new CertificateContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CertificateInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CertificateInstance + * + * @return CertificateInstance Fetched CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CertificateInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CertificateInstance + * + * @param array|Options $options Optional Arguments + * @return CertificateInstance Updated CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CertificateInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.CertificateInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php new file mode 100644 index 0000000..462d1ed --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php @@ -0,0 +1,209 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Certificates'; + } + + /** + * Create the CertificateInstance + * + * @param string $certificateData Provides a URL encoded representation of the public certificate in PEM format. + * @param array|Options $options Optional Arguments + * @return CertificateInstance Created CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $certificateData, array $options = []): CertificateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CertificateData' => + $certificateData, + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CertificateInstance 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 CertificatePage Page of CertificateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CertificatePage + { + $options = new Values($options); + + $params = Values::of([ + '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 CertificatePage Page of CertificateInstance + */ + public function getPage(string $targetUrl): CertificatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CertificatePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CertificateContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. + */ + public function getContext( + string $sid + + ): CertificateContext + { + return new CertificateContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.CertificateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php new file mode 100644 index 0000000..30fd558 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php @@ -0,0 +1,220 @@ +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 Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateCertificateOptions ' . $options . ']'; + } +} + + + +class ReadCertificateOptions extends Options + { + /** + * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. + */ + public function __construct( + + string $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 Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadCertificateOptions ' . $options . ']'; + } +} + +class UpdateCertificateOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $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 Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateCertificateOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php new file mode 100644 index 0000000..e48db45 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CertificateInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateInstance + */ + public function buildInstance(array $payload): CertificateInstance + { + return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.CertificatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php new file mode 100644 index 0000000..3fc779c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php @@ -0,0 +1,135 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Deployments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DeploymentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Updated DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'SyncServiceSid' => + $options['syncServiceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeploymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php new file mode 100644 index 0000000..855f669 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php @@ -0,0 +1,158 @@ +properties = [ + '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 = ['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 DeploymentContext Context for this DeploymentInstance + */ + protected function proxy(): DeploymentContext + { + if (!$this->context) { + $this->context = new DeploymentContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DeploymentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Updated DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeploymentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeploymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php new file mode 100644 index 0000000..fa131e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php @@ -0,0 +1,200 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Deployments'; + } + + /** + * Create the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Created DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'SyncServiceSid' => + $options['syncServiceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DeploymentPage Page of DeploymentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeploymentPage + { + + $params = Values::of([ + '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 DeploymentPage Page of DeploymentInstance + */ + public function getPage(string $targetUrl): DeploymentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeploymentContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. + */ + public function getContext( + string $sid + + ): DeploymentContext + { + return new DeploymentContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeploymentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php new file mode 100644 index 0000000..a95ffbf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php @@ -0,0 +1,170 @@ +options['friendlyName'] = $friendlyName; + $this->options['syncServiceSid'] = $syncServiceSid; + } + + /** + * Provides a human readable descriptive text for this Deployment, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * @return $this Fluent Builder + */ + public function setSyncServiceSid(string $syncServiceSid): self + { + $this->options['syncServiceSid'] = $syncServiceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateDeploymentOptions ' . $options . ']'; + } +} + + + + +class UpdateDeploymentOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long + * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $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 Provides a human readable descriptive text for this Deployment, up to 64 characters long + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * @return $this Fluent Builder + */ + public function setSyncServiceSid(string $syncServiceSid): self + { + $this->options['syncServiceSid'] = $syncServiceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateDeploymentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php new file mode 100644 index 0000000..fefcf6c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeploymentInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentInstance + */ + public function buildInstance(array $payload): DeploymentInstance + { + return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeploymentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php new file mode 100644 index 0000000..51511b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php @@ -0,0 +1,140 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Devices/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DeviceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Identity' => + $options['identity'], + 'DeploymentSid' => + $options['deploymentSid'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeviceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php new file mode 100644 index 0000000..9aa62d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 DeviceContext Context for this DeviceInstance + */ + protected function proxy(): DeviceContext + { + if (!$this->context) { + $this->context = new DeviceContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeviceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php new file mode 100644 index 0000000..7fc3c07 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php @@ -0,0 +1,213 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Devices'; + } + + /** + * Create the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Created DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + 'Identity' => + $options['identity'], + 'DeploymentSid' => + $options['deploymentSid'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceInstance 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 DevicePage Page of DeviceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DevicePage + { + $options = new Values($options); + + $params = Values::of([ + '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 DevicePage Page of DeviceInstance + */ + public function getPage(string $targetUrl): DevicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DevicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. + */ + public function getContext( + string $sid + + ): DeviceContext + { + return new DeviceContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeviceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php new file mode 100644 index 0000000..53514ec --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php @@ -0,0 +1,310 @@ +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 Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $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 Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $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 Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * + * + * @param bool $enabled + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateDeviceOptions ' . $options . ']'; + } +} + + + +class ReadDeviceOptions extends Options + { + /** + * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. + */ + public function __construct( + + string $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 Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadDeviceOptions ' . $options . ']'; + } +} + +class UpdateDeviceOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @param bool $enabled + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $identity = Values::NONE, + string $deploymentSid = Values::NONE, + bool $enabled = Values::BOOL_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 Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $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 Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * + * + * @param bool $enabled + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateDeviceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php new file mode 100644 index 0000000..1a7bde1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceInstance + */ + public function buildInstance(array $payload): DeviceInstance + { + return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DevicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php new file mode 100644 index 0000000..eb3495a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php @@ -0,0 +1,135 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Keys/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.KeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php new file mode 100644 index 0000000..b29ebf0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 KeyContext Context for this KeyInstance + */ + protected function proxy(): KeyContext + { + if (!$this->context) { + $this->context = new KeyContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.KeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php new file mode 100644 index 0000000..04bcc0d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php @@ -0,0 +1,206 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Keys'; + } + + /** + * Create the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Created KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 KeyPage Page of KeyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): KeyPage + { + $options = new Values($options); + + $params = Values::of([ + '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 KeyPage Page of KeyInstance + */ + public function getPage(string $targetUrl): KeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new KeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a KeyContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. + */ + public function getContext( + string $sid + + ): KeyContext + { + return new KeyContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.KeyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php new file mode 100644 index 0000000..8213119 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php @@ -0,0 +1,220 @@ +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 Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateKeyOptions ' . $options . ']'; + } +} + + + +class ReadKeyOptions extends Options + { + /** + * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. + */ + public function __construct( + + string $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 Filters the resulting list of Keys by a unique string identifier of an authenticated Device. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadKeyOptions ' . $options . ']'; + } +} + +class UpdateKeyOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $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 Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateKeyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php new file mode 100644 index 0000000..0a9c02a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return KeyInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyInstance + */ + public function buildInstance(array $payload): KeyInstance + { + return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.KeyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php new file mode 100644 index 0000000..adcf791 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php @@ -0,0 +1,243 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FleetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultDeploymentSid' => + $options['defaultDeploymentSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the certificates + */ + protected function getCertificates(): CertificateList + { + if (!$this->_certificates) { + $this->_certificates = new CertificateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_certificates; + } + + /** + * Access the devices + */ + protected function getDevices(): DeviceList + { + if (!$this->_devices) { + $this->_devices = new DeviceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_devices; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + if (!$this->_keys) { + $this->_keys = new KeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_keys; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + if (!$this->_deployments) { + $this->_deployments = new DeploymentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deployments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.FleetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php new file mode 100644 index 0000000..123da2d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php @@ -0,0 +1,199 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FleetContext Context for this FleetInstance + */ + protected function proxy(): FleetContext + { + if (!$this->context) { + $this->context = new FleetContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FleetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the certificates + */ + protected function getCertificates(): CertificateList + { + return $this->proxy()->certificates; + } + + /** + * Access the devices + */ + protected function getDevices(): DeviceList + { + return $this->proxy()->devices; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + return $this->proxy()->keys; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + return $this->proxy()->deployments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.FleetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php new file mode 100644 index 0000000..106f6f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php @@ -0,0 +1,190 @@ +solution = [ + ]; + + $this->uri = '/Fleets'; + } + + /** + * Create the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Created FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FleetInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 FleetPage Page of FleetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FleetPage + { + + $params = Values::of([ + '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 FleetPage Page of FleetInstance + */ + public function getPage(string $targetUrl): FleetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FleetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FleetContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. + */ + public function getContext( + string $sid + + ): FleetContext + { + return new FleetContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.FleetList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php new file mode 100644 index 0000000..096f500 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateFleetOptions ' . $options . ']'; + } +} + + + + +class UpdateFleetOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $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 Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. + * @return $this Fluent Builder + */ + public function setDefaultDeploymentSid(string $defaultDeploymentSid): self + { + $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateFleetOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php new file mode 100644 index 0000000..8f334b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FleetInstance \Twilio\Rest\Preview\DeployedDevices\FleetInstance + */ + public function buildInstance(array $payload): FleetInstance + { + return new FleetInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.FleetPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers.php new file mode 100644 index 0000000..d3e1ee5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers.php @@ -0,0 +1,107 @@ +version = 'HostedNumbers'; + } + + protected function getAuthorizationDocuments(): AuthorizationDocumentList + { + if (!$this->_authorizationDocuments) { + $this->_authorizationDocuments = new AuthorizationDocumentList($this); + } + return $this->_authorizationDocuments; + } + + protected function getHostedNumberOrders(): HostedNumberOrderList + { + if (!$this->_hostedNumberOrders) { + $this->_hostedNumberOrders = new HostedNumberOrderList($this); + } + return $this->_hostedNumberOrders; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Preview.HostedNumbers]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php new file mode 100644 index 0000000..4d0ee65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php @@ -0,0 +1,125 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php new file mode 100644 index 0000000..766310c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php @@ -0,0 +1,166 @@ +solution = [ + 'signingDocumentSid' => + $signingDocumentSid, + + ]; + + $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) + .'/DependentHostedNumberOrders'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DependentHostedNumberOrderInstance 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 DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DependentHostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + '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 DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function getPage(string $targetUrl): DependentHostedNumberOrderPage + { + $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(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php new file mode 100644 index 0000000..2d31e4d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php @@ -0,0 +1,148 @@ +options['status'] = $status; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $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, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadDependentHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php new file mode 100644 index 0000000..31d27e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DependentHostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderInstance + */ + public function buildInstance(array $payload): DependentHostedNumberOrderInstance + { + return new DependentHostedNumberOrderInstance($this->version, $payload, $this->solution['signingDocumentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php new file mode 100644 index 0000000..1b09ecd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php @@ -0,0 +1,182 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/AuthorizationDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AuthorizationDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AuthorizationDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AuthorizationDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'HostedNumberOrderSids' => + Serialize::map($options['hostedNumberOrderSids'], function ($e) { return $e; }), + 'AddressSid' => + $options['addressSid'], + 'Email' => + $options['email'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + 'Status' => + $options['status'], + 'ContactTitle' => + $options['contactTitle'], + 'ContactPhoneNumber' => + $options['contactPhoneNumber'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AuthorizationDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php new file mode 100644 index 0000000..b325d96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php @@ -0,0 +1,157 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthorizationDocumentContext Context for this AuthorizationDocumentInstance + */ + protected function proxy(): AuthorizationDocumentContext + { + if (!$this->context) { + $this->context = new AuthorizationDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AuthorizationDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AuthorizationDocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php new file mode 100644 index 0000000..c025bf7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php @@ -0,0 +1,214 @@ +solution = [ + ]; + + $this->uri = '/AuthorizationDocuments'; + } + + /** + * Create the AuthorizationDocumentInstance + * + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $hostedNumberOrderSids, string $addressSid, string $email, string $contactTitle, string $contactPhoneNumber, array $options = []): AuthorizationDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'HostedNumberOrderSids' => + Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), + 'AddressSid' => + $addressSid, + 'Email' => + $email, + 'ContactTitle' => + $contactTitle, + 'ContactPhoneNumber' => + $contactPhoneNumber, + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AuthorizationDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthorizationDocumentInstance 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 AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthorizationDocumentPage + { + $options = new Values($options); + + $params = Values::of([ + '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 AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function getPage(string $targetUrl): AuthorizationDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthorizationDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthorizationDocumentContext + * + * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. + */ + public function getContext( + string $sid + + ): AuthorizationDocumentContext + { + return new AuthorizationDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php new file mode 100644 index 0000000..3eab69f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php @@ -0,0 +1,306 @@ +options['ccEmails'] = $ccEmails; + } + + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed. + * + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.CreateAuthorizationDocumentOptions ' . $options . ']'; + } +} + + +class ReadAuthorizationDocumentOptions extends Options + { + /** + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + */ + public function __construct( + + string $email = Values::NONE, + string $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 that this AuthorizationDocument will be sent to for signing. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadAuthorizationDocumentOptions ' . $options . ']'; + } +} + +class UpdateAuthorizationDocumentOptions extends Options + { + /** + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed + * @param string $status + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + */ + public function __construct( + + array $hostedNumberOrderSids = Values::ARRAY_NONE, + string $addressSid = Values::NONE, + string $email = Values::NONE, + array $ccEmails = Values::ARRAY_NONE, + string $status = Values::NONE, + string $contactTitle = Values::NONE, + string $contactPhoneNumber = Values::NONE + + ) { + $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; + $this->options['addressSid'] = $addressSid; + $this->options['email'] = $email; + $this->options['ccEmails'] = $ccEmails; + $this->options['status'] = $status; + $this->options['contactTitle'] = $contactTitle; + $this->options['contactPhoneNumber'] = $contactPhoneNumber; + } + + /** + * A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @return $this Fluent Builder + */ + public function setHostedNumberOrderSids(array $hostedNumberOrderSids): self + { + $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 A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * Email that this AuthorizationDocument will be sent to for signing. + * + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed + * + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + * + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @return $this Fluent Builder + */ + public function setContactTitle(string $contactTitle): self + { + $this->options['contactTitle'] = $contactTitle; + return $this; + } + + /** + * The contact phone number of the person authorized to sign the Authorization Document. + * + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @return $this Fluent Builder + */ + public function setContactPhoneNumber(string $contactPhoneNumber): self + { + $this->options['contactPhoneNumber'] = $contactPhoneNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.UpdateAuthorizationDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php new file mode 100644 index 0000000..db90282 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizationDocumentInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentInstance + */ + public function buildInstance(array $payload): AuthorizationDocumentInstance + { + return new AuthorizationDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php new file mode 100644 index 0000000..6e87055 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php @@ -0,0 +1,145 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new HostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the HostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): HostedNumberOrderInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new HostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php new file mode 100644 index 0000000..03cc300 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php @@ -0,0 +1,187 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance + */ + protected function proxy(): HostedNumberOrderContext + { + if (!$this->context) { + $this->context = new HostedNumberOrderContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the HostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): HostedNumberOrderInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php new file mode 100644 index 0000000..39d5142 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php @@ -0,0 +1,239 @@ +solution = [ + ]; + + $this->uri = '/HostedNumberOrders'; + } + + /** + * Create the HostedNumberOrderInstance + * + * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format + * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Created HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, bool $smsCapability, array $options = []): HostedNumberOrderInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new HostedNumberOrderInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of HostedNumberOrderInstance 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 HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): HostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + '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 HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function getPage(string $targetUrl): HostedNumberOrderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new HostedNumberOrderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a HostedNumberOrderContext + * + * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. + */ + public function getContext( + string $sid + + ): HostedNumberOrderContext + { + return new HostedNumberOrderContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php new file mode 100644 index 0000000..7a93c1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php @@ -0,0 +1,664 @@ +options['accountSid'] = $accountSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['ccEmails'] = $ccEmails; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['addressSid'] = $addressSid; + $this->options['email'] = $email; + $this->options['verificationType'] = $verificationType; + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + } + + /** + * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * + * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * A 64 character string that is a human readable text that describes this resource. + * + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 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. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $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 Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $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 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. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $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 Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * Optional. Email of the owner of this phone number that is being hosted. + * + * @param string $email Optional. Email of the owner of this phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * @param string $verificationType + * @return $this Fluent Builder + */ + public function setVerificationType(string $verificationType): self + { + $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 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. + * @return $this Fluent Builder + */ + public function setVerificationDocumentSid(string $verificationDocumentSid): self + { + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.CreateHostedNumberOrderOptions ' . $options . ']'; + } +} + + + +class ReadHostedNumberOrderOptions extends Options + { + /** + * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + */ + public function __construct( + + string $status = Values::NONE, + string $phoneNumber = Values::NONE, + string $incomingPhoneNumberSid = Values::NONE, + string $friendlyName = Values::NONE, + string $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. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $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, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadHostedNumberOrderOptions ' . $options . ']'; + } +} + +class UpdateHostedNumberOrderOptions extends Options + { + /** + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @param string $uniqueName 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 $email Email of the owner of this phone number that is being hosted. + * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + * @param string $status + * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. + * @param string $verificationType + * @param string $verificationDocumentSid 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 $extension Digits to dial after connecting the verification call. + * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $email = Values::NONE, + array $ccEmails = Values::ARRAY_NONE, + string $status = Values::NONE, + string $verificationCode = Values::NONE, + string $verificationType = Values::NONE, + string $verificationDocumentSid = Values::NONE, + string $extension = Values::NONE, + int $callDelay = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['email'] = $email; + $this->options['ccEmails'] = $ccEmails; + $this->options['status'] = $status; + $this->options['verificationCode'] = $verificationCode; + $this->options['verificationType'] = $verificationType; + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + $this->options['extension'] = $extension; + $this->options['callDelay'] = $callDelay; + } + + /** + * A 64 character string that is a human readable text that describes this resource. + * + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $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 Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Email of the owner of this phone number that is being hosted. + * + * @param string $email Email of the owner of this phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $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 Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $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 that is given to the user via a phone call to the phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setVerificationCode(string $verificationCode): self + { + $this->options['verificationCode'] = $verificationCode; + return $this; + } + + /** + * @param string $verificationType + * @return $this Fluent Builder + */ + public function setVerificationType(string $verificationType): self + { + $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 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. + * @return $this Fluent Builder + */ + public function setVerificationDocumentSid(string $verificationDocumentSid): self + { + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + return $this; + } + + /** + * Digits to dial after connecting the verification call. + * + * @param string $extension Digits to dial after connecting the verification call. + * @return $this Fluent Builder + */ + public function setExtension(string $extension): self + { + $this->options['extension'] = $extension; + return $this; + } + + /** + * The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + * + * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + * @return $this Fluent Builder + */ + public function setCallDelay(int $callDelay): self + { + $this->options['callDelay'] = $callDelay; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.UpdateHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php new file mode 100644 index 0000000..77de049 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return HostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderInstance + */ + public function buildInstance(array $payload): HostedNumberOrderInstance + { + return new HostedNumberOrderInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace.php new file mode 100644 index 0000000..8c0775c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace.php @@ -0,0 +1,107 @@ +version = 'marketplace'; + } + + protected function getAvailableAddOns(): AvailableAddOnList + { + if (!$this->_availableAddOns) { + $this->_availableAddOns = new AvailableAddOnList($this); + } + return $this->_availableAddOns; + } + + protected function getInstalledAddOns(): InstalledAddOnList + { + if (!$this->_installedAddOns) { + $this->_installedAddOns = new InstalledAddOnList($this); + } + return $this->_installedAddOns; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Preview.Marketplace]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php new file mode 100644 index 0000000..bb9f50c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php @@ -0,0 +1,89 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AvailableAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php new file mode 100644 index 0000000..a42cb30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php @@ -0,0 +1,127 @@ +properties = [ + '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 = ['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 AvailableAddOnExtensionContext Context for this AvailableAddOnExtensionInstance + */ + protected function proxy(): AvailableAddOnExtensionContext + { + if (!$this->context) { + $this->context = new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php new file mode 100644 index 0000000..dffe382 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnExtensionPage + { + + $params = Values::of([ + '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 AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function getPage(string $targetUrl): AvailableAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnExtensionContext + * + * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnExtensionContext + { + return new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php new file mode 100644 index 0000000..e50034e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionInstance + */ + public function buildInstance(array $payload): AvailableAddOnExtensionInstance + { + return new AvailableAddOnExtensionInstance($this->version, $payload, $this->solution['availableAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php new file mode 100644 index 0000000..73abd80 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php @@ -0,0 +1,141 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AvailableAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php new file mode 100644 index 0000000..18dc145 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php @@ -0,0 +1,138 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AvailableAddOnContext Context for this AvailableAddOnInstance + */ + protected function proxy(): AvailableAddOnContext + { + if (!$this->context) { + $this->context = new AvailableAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php new file mode 100644 index 0000000..6885c33 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/AvailableAddOns'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnPage + { + + $params = Values::of([ + '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 AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function getPage(string $targetUrl): AvailableAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnContext + * + * @param string $sid The SID of the AvailableAddOn resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnContext + { + return new AvailableAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php new file mode 100644 index 0000000..497df13 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOnInstance + */ + public function buildInstance(array $payload): AvailableAddOnInstance + { + return new AvailableAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php new file mode 100644 index 0000000..7edef5d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php @@ -0,0 +1,117 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + $data = Values::of([ + 'Enabled' => + Serialize::booleanToString($enabled), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php new file mode 100644 index 0000000..276ff94 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php @@ -0,0 +1,142 @@ +properties = [ + '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 = ['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 InstalledAddOnExtensionContext Context for this InstalledAddOnExtensionInstance + */ + protected function proxy(): InstalledAddOnExtensionContext + { + if (!$this->context) { + $this->context = new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php new file mode 100644 index 0000000..3bd0214 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnExtensionPage + { + + $params = Values::of([ + '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 InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function getPage(string $targetUrl): InstalledAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnExtensionContext + * + * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): InstalledAddOnExtensionContext + { + return new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php new file mode 100644 index 0000000..d8139e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionInstance + */ + public function buildInstance(array $payload): InstalledAddOnExtensionInstance + { + return new InstalledAddOnExtensionInstance($this->version, $payload, $this->solution['installedAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php new file mode 100644 index 0000000..14f77e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php @@ -0,0 +1,187 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php new file mode 100644 index 0000000..429af18 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php @@ -0,0 +1,171 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InstalledAddOnContext Context for this InstalledAddOnInstance + */ + protected function proxy(): InstalledAddOnContext + { + if (!$this->context) { + $this->context = new InstalledAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php new file mode 100644 index 0000000..a443f2f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php @@ -0,0 +1,199 @@ +solution = [ + ]; + + $this->uri = '/InstalledAddOns'; + } + + /** + * Create the InstalledAddOnInstance + * + * @param string $availableAddOnSid The SID of the AvaliableAddOn to install. + * @param bool $acceptTermsOfService Whether the Terms of Service were accepted. + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Created InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $availableAddOnSid, bool $acceptTermsOfService, array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AvailableAddOnSid' => + $availableAddOnSid, + 'AcceptTermsOfService' => + Serialize::booleanToString($acceptTermsOfService), + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InstalledAddOnInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnPage + { + + $params = Values::of([ + '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 InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function getPage(string $targetUrl): InstalledAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnContext + * + * @param string $sid The SID of the InstalledAddOn resource to delete. + */ + public function getContext( + string $sid + + ): InstalledAddOnContext + { + return new InstalledAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php new file mode 100644 index 0000000..911c018 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php @@ -0,0 +1,170 @@ +options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The JSON object that represents the configuration of the new Add-on being installed. + * + * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Marketplace.CreateInstalledAddOnOptions ' . $options . ']'; + } +} + + + + +class UpdateInstalledAddOnOptions extends Options + { + /** + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + */ + public function __construct( + + array $configuration = Values::ARRAY_NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Marketplace.UpdateInstalledAddOnOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php new file mode 100644 index 0000000..ed1c381 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOnInstance + */ + public function buildInstance(array $payload): InstalledAddOnInstance + { + return new InstalledAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync.php new file mode 100644 index 0000000..145e972 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync.php @@ -0,0 +1,95 @@ +version = 'Sync'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Preview.Sync]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php new file mode 100644 index 0000000..e3c45d7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'documentSid' => + $documentSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. + * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php new file mode 100644 index 0000000..858ad69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 DocumentPermissionContext Context for this DocumentPermissionInstance + */ + protected function proxy(): DocumentPermissionContext + { + if (!$this->context) { + $this->context = new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. + * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php new file mode 100644 index 0000000..8460523 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'documentSid' => + $documentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPermissionPage + { + + $params = Values::of([ + '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 DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function getPage(string $targetUrl): DocumentPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): DocumentPermissionContext + { + return new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php new file mode 100644 index 0000000..fc8bac0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentPermissionInstance \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionInstance + */ + public function buildInstance(array $payload): DocumentPermissionInstance + { + return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php new file mode 100644 index 0000000..664d089 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DocumentInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php new file mode 100644 index 0000000..cad5d7c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php @@ -0,0 +1,176 @@ +properties = [ + '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 = ['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 DocumentContext Context for this DocumentInstance + */ + protected function proxy(): DocumentContext + { + if (!$this->context) { + $this->context = new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): DocumentInstance + { + + return $this->proxy()->update($data, $options); + } + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php new file mode 100644 index 0000000..4784091 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents'; + } + + /** + * Create the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Created DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Data' => + Serialize::jsonObject($options['data']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DocumentPage Page of DocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPage + { + + $params = Values::of([ + '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 DocumentPage Page of DocumentInstance + */ + public function getPage(string $targetUrl): DocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): DocumentContext + { + return new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php new file mode 100644 index 0000000..04dce01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php @@ -0,0 +1,152 @@ +options['uniqueName'] = $uniqueName; + $this->options['data'] = $data; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param array $data + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateDocumentOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php new file mode 100644 index 0000000..0a58e37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentInstance \Twilio\Rest\Preview\Sync\Service\DocumentInstance + */ + public function buildInstance(array $payload): DocumentInstance + { + return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php new file mode 100644 index 0000000..e2d966a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php @@ -0,0 +1,145 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'index' => + $index, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items/' . \rawurlencode($index) + .''; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Update the SyncListItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php new file mode 100644 index 0000000..7adb5c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 SyncListItemContext Context for this SyncListItemInstance + */ + protected function proxy(): SyncListItemContext + { + if (!$this->context) { + $this->context = new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncListItemInstance + { + + return $this->proxy()->update($data, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php new file mode 100644 index 0000000..0cdea8a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items'; + } + + /** + * Create the SyncListItemInstance + * + * @param array $data + * @return SyncListItemInstance Created SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data): SyncListItemInstance + { + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListItemInstance 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 SyncListItemPage Page of SyncListItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListItemPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SyncListItemPage Page of SyncListItemInstance + */ + public function getPage(string $targetUrl): SyncListItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListItemContext + * + * @param int $index + */ + public function getContext( + int $index + + ): SyncListItemContext + { + return new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $index + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListItemList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php new file mode 100644 index 0000000..d5a459c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php @@ -0,0 +1,220 @@ +options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.DeleteSyncListItemOptions ' . $options . ']'; + } +} + + +class ReadSyncListItemOptions extends Options + { + /** + * @param string $order + * @param string $from + * @param string $bounds + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $bounds + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.ReadSyncListItemOptions ' . $options . ']'; + } +} + +class UpdateSyncListItemOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateSyncListItemOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php new file mode 100644 index 0000000..be491a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListItemInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemInstance + */ + public function buildInstance(array $payload): SyncListItemInstance + { + return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListItemPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php new file mode 100644 index 0000000..153c239 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync List. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php new file mode 100644 index 0000000..3c85ae2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 SyncListPermissionContext Context for this SyncListPermissionInstance + */ + protected function proxy(): SyncListPermissionContext + { + if (!$this->context) { + $this->context = new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync List. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php new file mode 100644 index 0000000..50b9333 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPermissionPage + { + + $params = Values::of([ + '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 SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function getPage(string $targetUrl): SyncListPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): SyncListPermissionContext + { + return new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php new file mode 100644 index 0000000..8e2366d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionInstance + */ + public function buildInstance(array $payload): SyncListPermissionInstance + { + return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php new file mode 100644 index 0000000..ec8cf6e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + if (!$this->_syncListPermissions) { + $this->_syncListPermissions = new SyncListPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + if (!$this->_syncListItems) { + $this->_syncListItems = new SyncListItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListItems; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php new file mode 100644 index 0000000..9439999 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php @@ -0,0 +1,169 @@ +properties = [ + '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 = ['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 SyncListContext Context for this SyncListInstance + */ + protected function proxy(): SyncListContext + { + if (!$this->context) { + $this->context = new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + return $this->proxy()->syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + return $this->proxy()->syncListItems; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php new file mode 100644 index 0000000..530fd1b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php @@ -0,0 +1,198 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists'; + } + + /** + * Create the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Created SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncListPage Page of SyncListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPage + { + + $params = Values::of([ + '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 SyncListPage Page of SyncListInstance + */ + public function getPage(string $targetUrl): SyncListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SyncListContext + { + return new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php new file mode 100644 index 0000000..d0cf33e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php @@ -0,0 +1,82 @@ +options['uniqueName'] = $uniqueName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateSyncListOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php new file mode 100644 index 0000000..3842b53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListInstance \Twilio\Rest\Preview\Sync\Service\SyncListInstance + */ + public function buildInstance(array $payload): SyncListInstance + { + return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php new file mode 100644 index 0000000..3a21409 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php @@ -0,0 +1,145 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'key' => + $key, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items/' . \rawurlencode($key) + .''; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Update the SyncMapItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php new file mode 100644 index 0000000..99f01c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php @@ -0,0 +1,166 @@ +properties = [ + '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 = ['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 SyncMapItemContext Context for this SyncMapItemInstance + */ + protected function proxy(): SyncMapItemContext + { + if (!$this->context) { + $this->context = new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncMapItemInstance + { + + return $this->proxy()->update($data, $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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php new file mode 100644 index 0000000..0238bae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php @@ -0,0 +1,218 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items'; + } + + /** + * Create the SyncMapItemInstance + * + * @param string $key + * @param array $data + * @return SyncMapItemInstance Created SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, array $data): SyncMapItemInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapItemInstance 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 SyncMapItemPage Page of SyncMapItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapItemPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SyncMapItemPage Page of SyncMapItemInstance + */ + public function getPage(string $targetUrl): SyncMapItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapItemContext + * + * @param string $key + */ + public function getContext( + string $key + + ): SyncMapItemContext + { + return new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapItemList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php new file mode 100644 index 0000000..3fce5ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php @@ -0,0 +1,220 @@ +options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.DeleteSyncMapItemOptions ' . $options . ']'; + } +} + + +class ReadSyncMapItemOptions extends Options + { + /** + * @param string $order + * @param string $from + * @param string $bounds + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $bounds + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.ReadSyncMapItemOptions ' . $options . ']'; + } +} + +class UpdateSyncMapItemOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateSyncMapItemOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php new file mode 100644 index 0000000..c9a7e90 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapItemInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemInstance + */ + public function buildInstance(array $payload): SyncMapItemInstance + { + return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapItemPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php new file mode 100644 index 0000000..d2486f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php new file mode 100644 index 0000000..6bbdc1e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 SyncMapPermissionContext Context for this SyncMapPermissionInstance + */ + protected function proxy(): SyncMapPermissionContext + { + if (!$this->context) { + $this->context = new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php new file mode 100644 index 0000000..85071a9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPermissionPage + { + + $params = Values::of([ + '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 SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function getPage(string $targetUrl): SyncMapPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): SyncMapPermissionContext + { + return new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php new file mode 100644 index 0000000..999be46 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionInstance + */ + public function buildInstance(array $payload): SyncMapPermissionInstance + { + return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php new file mode 100644 index 0000000..38d42ab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + if (!$this->_syncMapItems) { + $this->_syncMapItems = new SyncMapItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php new file mode 100644 index 0000000..e4fd23f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php @@ -0,0 +1,169 @@ +properties = [ + '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 = ['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 SyncMapContext Context for this SyncMapInstance + */ + protected function proxy(): SyncMapContext + { + if (!$this->context) { + $this->context = new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + return $this->proxy()->syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php new file mode 100644 index 0000000..c032c17 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php @@ -0,0 +1,198 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps'; + } + + /** + * Create the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Created SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncMapPage Page of SyncMapInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPage + { + + $params = Values::of([ + '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 SyncMapPage Page of SyncMapInstance + */ + public function getPage(string $targetUrl): SyncMapPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SyncMapContext + { + return new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php new file mode 100644 index 0000000..e0b1b31 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php @@ -0,0 +1,82 @@ +options['uniqueName'] = $uniqueName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateSyncMapOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php new file mode 100644 index 0000000..dd028b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapInstance \Twilio\Rest\Preview\Sync\Service\SyncMapInstance + */ + public function buildInstance(array $payload): SyncMapInstance + { + return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php new file mode 100644 index 0000000..ea9d941 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php @@ -0,0 +1,229 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'WebhookUrl' => + $options['webhookUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + if (!$this->_syncLists) { + $this->_syncLists = new SyncListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncLists; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + if (!$this->_syncMaps) { + $this->_syncMaps = new SyncMapList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncMaps; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + if (!$this->_documents) { + $this->_documents = new DocumentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_documents; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php new file mode 100644 index 0000000..0f0322b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php @@ -0,0 +1,191 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + return $this->proxy()->syncLists; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + return $this->proxy()->syncMaps; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + return $this->proxy()->documents; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php new file mode 100644 index 0000000..a5b7328 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'WebhookUrl' => + $options['webhookUrl'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php new file mode 100644 index 0000000..3e107f9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php @@ -0,0 +1,242 @@ +options['friendlyName'] = $friendlyName; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $webhookUrl + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * + * + * @param bool $reachabilityWebhooksEnabled + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * + * + * @param bool $aclEnabled + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $webhookUrl + * @param string $friendlyName + * @param bool $reachabilityWebhooksEnabled + * @param bool $aclEnabled + */ + public function __construct( + + string $webhookUrl = Values::NONE, + string $friendlyName = Values::NONE, + bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, + bool $aclEnabled = Values::BOOL_NONE + + ) { + $this->options['webhookUrl'] = $webhookUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + } + + /** + * + * + * @param string $webhookUrl + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param bool $reachabilityWebhooksEnabled + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * + * + * @param bool $aclEnabled + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php new file mode 100644 index 0000000..91cb677 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Preview\Sync\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless.php new file mode 100644 index 0000000..e34a029 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless.php @@ -0,0 +1,119 @@ +version = 'wireless'; + } + + protected function getCommands(): CommandList + { + if (!$this->_commands) { + $this->_commands = new CommandList($this); + } + return $this->_commands; + } + + protected function getRatePlans(): RatePlanList + { + if (!$this->_ratePlans) { + $this->_ratePlans = new RatePlanList($this); + } + return $this->_ratePlans; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Preview.Wireless]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php new file mode 100644 index 0000000..6491968 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Commands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.CommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php new file mode 100644 index 0000000..feb7fcc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php @@ -0,0 +1,136 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CommandContext Context for this CommandInstance + */ + protected function proxy(): CommandContext + { + if (!$this->context) { + $this->context = new CommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.CommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php new file mode 100644 index 0000000..9dc0842 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php @@ -0,0 +1,215 @@ +solution = [ + ]; + + $this->uri = '/Commands'; + } + + /** + * Create the CommandInstance + * + * @param string $command + * @param array|Options $options Optional Arguments + * @return CommandInstance Created CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $command, array $options = []): CommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Command' => + $command, + 'Device' => + $options['device'], + 'Sim' => + $options['sim'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CommandMode' => + $options['commandMode'], + 'IncludeSid' => + $options['includeSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CommandInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CommandInstance 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 CommandPage Page of CommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CommandPage + { + $options = new Values($options); + + $params = Values::of([ + '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 CommandPage Page of CommandInstance + */ + public function getPage(string $targetUrl): CommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CommandContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CommandContext + { + return new CommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.CommandList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php new file mode 100644 index 0000000..bda0312 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php @@ -0,0 +1,274 @@ +options['device'] = $device; + $this->options['sim'] = $sim; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['commandMode'] = $commandMode; + $this->options['includeSid'] = $includeSid; + } + + /** + * + * + * @param string $device + * @return $this Fluent Builder + */ + public function setDevice(string $device): self + { + $this->options['device'] = $device; + return $this; + } + + /** + * + * + * @param string $sim + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * + * + * @param string $callbackMethod + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * + * + * @param string $callbackUrl + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * + * + * @param string $commandMode + * @return $this Fluent Builder + */ + public function setCommandMode(string $commandMode): self + { + $this->options['commandMode'] = $commandMode; + return $this; + } + + /** + * + * + * @param string $includeSid + * @return $this Fluent Builder + */ + public function setIncludeSid(string $includeSid): self + { + $this->options['includeSid'] = $includeSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.CreateCommandOptions ' . $options . ']'; + } +} + + +class ReadCommandOptions extends Options + { + /** + * @param string $device + * @param string $sim + * @param string $status + * @param string $direction + */ + public function __construct( + + string $device = Values::NONE, + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['device'] = $device; + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * + * + * @param string $device + * @return $this Fluent Builder + */ + public function setDevice(string $device): self + { + $this->options['device'] = $device; + return $this; + } + + /** + * + * + * @param string $sim + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $direction + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.ReadCommandOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php new file mode 100644 index 0000000..2717341 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CommandInstance \Twilio\Rest\Preview\Wireless\CommandInstance + */ + public function buildInstance(array $payload): CommandInstance + { + return new CommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.CommandPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php new file mode 100644 index 0000000..966d5f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php @@ -0,0 +1,128 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RatePlans/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.RatePlanContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php new file mode 100644 index 0000000..eee210c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php @@ -0,0 +1,168 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RatePlanContext Context for this RatePlanInstance + */ + protected function proxy(): RatePlanContext + { + if (!$this->context) { + $this->context = new RatePlanContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.RatePlanInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php new file mode 100644 index 0000000..3eb02bf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php @@ -0,0 +1,209 @@ +solution = [ + ]; + + $this->uri = '/RatePlans'; + } + + /** + * Create the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Created RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RatePlanInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RatePlanPage Page of RatePlanInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RatePlanPage + { + + $params = Values::of([ + '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 RatePlanPage Page of RatePlanInstance + */ + public function getPage(string $targetUrl): RatePlanPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RatePlanContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RatePlanContext + { + return new RatePlanContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.RatePlanList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php new file mode 100644 index 0000000..d9c89ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php @@ -0,0 +1,314 @@ +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; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param bool $dataEnabled + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * + * + * @param int $dataLimit + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * + * + * @param string $dataMetering + * @return $this Fluent Builder + */ + public function setDataMetering(string $dataMetering): self + { + $this->options['dataMetering'] = $dataMetering; + return $this; + } + + /** + * + * + * @param bool $messagingEnabled + * @return $this Fluent Builder + */ + public function setMessagingEnabled(bool $messagingEnabled): self + { + $this->options['messagingEnabled'] = $messagingEnabled; + return $this; + } + + /** + * + * + * @param bool $voiceEnabled + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * + * + * @param bool $commandsEnabled + * @return $this Fluent Builder + */ + public function setCommandsEnabled(bool $commandsEnabled): self + { + $this->options['commandsEnabled'] = $commandsEnabled; + return $this; + } + + /** + * + * + * @param bool $nationalRoamingEnabled + * @return $this Fluent Builder + */ + public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self + { + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + return $this; + } + + /** + * + * + * @param string[] $internationalRoaming + * @return $this Fluent Builder + */ + public function setInternationalRoaming(array $internationalRoaming): self + { + $this->options['internationalRoaming'] = $internationalRoaming; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.CreateRatePlanOptions ' . $options . ']'; + } +} + + + + +class UpdateRatePlanOptions extends Options + { + /** + * @param string $uniqueName + * @param string $friendlyName + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.UpdateRatePlanOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php new file mode 100644 index 0000000..79c247f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RatePlanInstance \Twilio\Rest\Preview\Wireless\RatePlanInstance + */ + public function buildInstance(array $payload): RatePlanInstance + { + return new RatePlanInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.RatePlanPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php new file mode 100644 index 0000000..c665365 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php @@ -0,0 +1,94 @@ +solution = [ + 'simSid' => + $simSid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/Usage'; + } + + /** + * Fetch the UsageInstance + * + * @param array|Options $options Optional Arguments + * @return UsageInstance Fetched UsageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsageInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'End' => + $options['end'], + 'Start' => + $options['start'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new UsageInstance( + $this->version, + $payload, + $this->solution['simSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.UsageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php new file mode 100644 index 0000000..673d12b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php @@ -0,0 +1,133 @@ +properties = [ + '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 = ['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 UsageContext Context for this UsageInstance + */ + protected function proxy(): UsageContext + { + if (!$this->context) { + $this->context = new UsageContext( + $this->version, + $this->solution['simSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the UsageInstance + * + * @param array|Options $options Optional Arguments + * @return UsageInstance Fetched UsageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsageInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.UsageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php new file mode 100644 index 0000000..0578076 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php @@ -0,0 +1,67 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + } + + /** + * Constructs a UsageContext + */ + public function getContext( + + ): UsageContext + { + return new UsageContext( + $this->version, + $this->solution['simSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.UsageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php new file mode 100644 index 0000000..c71e934 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php @@ -0,0 +1,94 @@ +options['end'] = $end; + $this->options['start'] = $start; + } + + /** + * + * + * @param string $end + * @return $this Fluent Builder + */ + public function setEnd(string $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * + * + * @param string $start + * @return $this Fluent Builder + */ + public function setStart(string $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.FetchUsageOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php new file mode 100644 index 0000000..ef58191 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageInstance \Twilio\Rest\Preview\Wireless\Sim\UsageInstance + */ + public function buildInstance(array $payload): UsageInstance + { + return new UsageInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.UsagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php new file mode 100644 index 0000000..fa87085 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php @@ -0,0 +1,200 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php new file mode 100644 index 0000000..5b9aeef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php @@ -0,0 +1,183 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimList.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimList.php new file mode 100644 index 0000000..c1e079f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimList.php @@ -0,0 +1,176 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance 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 SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.SimList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php new file mode 100644 index 0000000..73d12a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php @@ -0,0 +1,472 @@ +options['status'] = $status; + $this->options['iccid'] = $iccid; + $this->options['ratePlan'] = $ratePlan; + $this->options['eId'] = $eId; + $this->options['simRegistrationCode'] = $simRegistrationCode; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $iccid + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * + * + * @param string $ratePlan + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * + * + * @param string $eId + * @return $this Fluent Builder + */ + public function setEId(string $eId): self + { + $this->options['eId'] = $eId; + return $this; + } + + /** + * + * + * @param string $simRegistrationCode + * @return $this Fluent Builder + */ + public function setSimRegistrationCode(string $simRegistrationCode): self + { + $this->options['simRegistrationCode'] = $simRegistrationCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName + * @param string $callbackMethod + * @param string $callbackUrl + * @param string $friendlyName + * @param string $ratePlan + * @param string $status + * @param string $commandsCallbackMethod + * @param string $commandsCallbackUrl + * @param string $smsFallbackMethod + * @param string $smsFallbackUrl + * @param string $smsMethod + * @param string $smsUrl + * @param string $voiceFallbackMethod + * @param string $voiceFallbackUrl + * @param string $voiceMethod + * @param string $voiceUrl + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE, + string $ratePlan = Values::NONE, + string $status = Values::NONE, + string $commandsCallbackMethod = Values::NONE, + string $commandsCallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $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; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $callbackMethod + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * + * + * @param string $callbackUrl + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $ratePlan + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $commandsCallbackMethod + * @return $this Fluent Builder + */ + public function setCommandsCallbackMethod(string $commandsCallbackMethod): self + { + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + return $this; + } + + /** + * + * + * @param string $commandsCallbackUrl + * @return $this Fluent Builder + */ + public function setCommandsCallbackUrl(string $commandsCallbackUrl): self + { + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + return $this; + } + + /** + * + * + * @param string $smsFallbackMethod + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * + * + * @param string $smsFallbackUrl + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * + * + * @param string $smsMethod + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * + * + * @param string $smsUrl + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * + * + * @param string $voiceFallbackMethod + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * + * + * @param string $voiceFallbackUrl + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * + * + * @param string $voiceMethod + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * + * + * @param string $voiceUrl + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php new file mode 100644 index 0000000..e2945ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Preview\Wireless\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.SimPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/PreviewBase.php b/vendor/twilio/sdk/src/Twilio/Rest/PreviewBase.php new file mode 100644 index 0000000..20051df --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/PreviewBase.php @@ -0,0 +1,140 @@ +baseUrl = 'https://preview.twilio.com'; + } + + + /** + * @return DeployedDevices Version deployedDevices of preview + */ + protected function getDeployedDevices(): DeployedDevices { + if (!$this->_deployedDevices) { + $this->_deployedDevices = new DeployedDevices($this); + } + return $this->_deployedDevices; + } + + /** + * @return HostedNumbers Version hostedNumbers of preview + */ + protected function getHostedNumbers(): HostedNumbers { + if (!$this->_hostedNumbers) { + $this->_hostedNumbers = new HostedNumbers($this); + } + return $this->_hostedNumbers; + } + + /** + * @return Sync Version sync of preview + */ + protected function getSync(): Sync { + if (!$this->_sync) { + $this->_sync = new Sync($this); + } + return $this->_sync; + } + + /** + * @return Marketplace Version marketplace of preview + */ + protected function getMarketplace(): Marketplace { + if (!$this->_marketplace) { + $this->_marketplace = new Marketplace($this); + } + return $this->_marketplace; + } + + /** + * @return Wireless Version wireless of preview + */ + protected function getWireless(): Wireless { + 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 TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Preview]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/PreviewIam.php b/vendor/twilio/sdk/src/Twilio/Rest/PreviewIam.php new file mode 100644 index 0000000..7f9d782 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/PreviewIam.php @@ -0,0 +1,5 @@ +baseUrl = 'https://preview-iam.twilio.com'; + } + + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.PreviewIam]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/PreviewMessaging.php b/vendor/twilio/sdk/src/Twilio/Rest/PreviewMessaging.php new file mode 100644 index 0000000..2fd257a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/PreviewMessaging.php @@ -0,0 +1,21 @@ +oauth instead. + */ + protected function getMessages(): \Twilio\Rest\PreviewMessaging\V1\MessageList { + return $this->v1->messages; + } + + /** + * @deprecated Use v1->oauth() instead. + */ + protected function getBroadcasts(): \Twilio\Rest\PreviewMessaging\V1\BroadcastList { + return $this->v1->broadcasts; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing.php new file mode 100644 index 0000000..8357802 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing.php @@ -0,0 +1,68 @@ +messaging instead. + */ + protected function getMessaging(): \Twilio\Rest\Pricing\V1\MessagingList { + echo "messaging is deprecated. Use v1->messaging instead."; + return $this->v1->messaging; + } + + /** + * @deprecated Use v1->phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Pricing\V1\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; + return $this->v1->phoneNumbers; + } + + /** + * @deprecated Use v2->voice instead. + */ + protected function getVoice(): \Twilio\Rest\Pricing\V2\VoiceList { + echo "voice is deprecated. Use v2->voice instead."; + return $this->v2->voice; + } + + /** + * @deprecated Use v2->countries instead. + */ + protected function getCountries(): \Twilio\Rest\Pricing\V2\CountryList { + echo "countries is deprecated. Use v2->countries instead."; + return $this->v2->countries; + } + + /** + * @deprecated Use v2->countries(\$isoCountry) instead. + * @param string $isoCountry The ISO country code of the pricing information to + * fetch + */ + protected function contextCountries(string $isoCountry): \Twilio\Rest\Pricing\V2\CountryContext { + echo "countries(\$isoCountry) is deprecated. Use v2->countries(\$isoCountry) instead."; + return $this->v2->countries($isoCountry); + } + + /** + * @deprecated Use v2->numbers instead. + */ + protected function getNumbers(): \Twilio\Rest\Pricing\V2\NumberList { + echo "numbers is deprecated. Use v2->numbers instead."; + return $this->v2->numbers; + } + + /** + * @deprecated Use v2->numbers(\$destinationNumber) instead. + * @param string $destinationNumber The destination number for which to fetch + * pricing information + */ + protected function contextNumbers(string $destinationNumber): \Twilio\Rest\Pricing\V2\NumberContext { + echo "numbers(\$destinationNumber) is deprecated. Use v2->numbers(\$destinationNumber) instead."; + return $this->v2->numbers($destinationNumber); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1.php new file mode 100644 index 0000000..600c9c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1.php @@ -0,0 +1,116 @@ +version = 'v1'; + } + + protected function getMessaging(): MessagingList + { + if (!$this->_messaging) { + $this->_messaging = new MessagingList($this); + } + return $this->_messaging; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + protected function getVoice(): VoiceList + { + if (!$this->_voice) { + $this->_voice = new VoiceList($this); + } + return $this->_voice; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php new file mode 100644 index 0000000..3dcc6cf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php @@ -0,0 +1,83 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Messaging/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php new file mode 100644 index 0000000..9e025c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundSmsPrices' => Values::array_get($payload, 'outbound_sms_prices'), + 'inboundSmsPrices' => Values::array_get($payload, 'inbound_sms_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php new file mode 100644 index 0000000..ac337c4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Messaging/Countries'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + '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 CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php new file mode 100644 index 0000000..5f1a01b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\Messaging\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php new file mode 100644 index 0000000..55fe543 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.MessagingInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php new file mode 100644 index 0000000..668fe4c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php @@ -0,0 +1,106 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V1.MessagingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php new file mode 100644 index 0000000..32fd62a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessagingInstance \Twilio\Rest\Pricing\V1\MessagingInstance + */ + public function buildInstance(array $payload): MessagingInstance + { + return new MessagingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.MessagingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php new file mode 100644 index 0000000..73f47d5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php @@ -0,0 +1,83 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/PhoneNumbers/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php new file mode 100644 index 0000000..0d945fe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'phoneNumberPrices' => Values::array_get($payload, 'phone_number_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php new file mode 100644 index 0000000..cc8bdd2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/PhoneNumbers/Countries'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + '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 CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php new file mode 100644 index 0000000..c9f6fd3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\PhoneNumber\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php new file mode 100644 index 0000000..6202899 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.PhoneNumberInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php new file mode 100644 index 0000000..c79d064 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php @@ -0,0 +1,106 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V1.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php new file mode 100644 index 0000000..0fff46a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Pricing\V1\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php new file mode 100644 index 0000000..2abaa69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php @@ -0,0 +1,83 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php new file mode 100644 index 0000000..2e7ca2b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), + 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php new file mode 100644 index 0000000..4fea82f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Voice/Countries'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + '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 CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php new file mode 100644 index 0000000..28d7a83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\Voice\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php new file mode 100644 index 0000000..9503833 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php @@ -0,0 +1,83 @@ +solution = [ + 'number' => + $number, + ]; + + $this->uri = '/Voice/Numbers/' . \rawurlencode($number) + .''; + } + + /** + * Fetch the NumberInstance + * + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['number'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php new file mode 100644 index 0000000..a2aeb13 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php @@ -0,0 +1,127 @@ +properties = [ + '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 = ['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 NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['number'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php new file mode 100644 index 0000000..47dfe36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $number The phone number to fetch. + */ + public function getContext( + string $number + + ): NumberContext + { + return new NumberContext( + $this->version, + $number + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.NumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php new file mode 100644 index 0000000..2ea0e0d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V1\Voice\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.NumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php new file mode 100644 index 0000000..114f841 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.VoiceInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php new file mode 100644 index 0000000..b3e80d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the numbers + */ + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList( + $this->version + ); + } + return $this->_numbers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V1.VoiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php new file mode 100644 index 0000000..d412643 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoiceInstance \Twilio\Rest\Pricing\V1\VoiceInstance + */ + public function buildInstance(array $payload): VoiceInstance + { + return new VoiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.VoicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2.php new file mode 100644 index 0000000..5899c74 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2.php @@ -0,0 +1,118 @@ +version = 'v2'; + } + + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList($this); + } + return $this->_countries; + } + + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList($this); + } + return $this->_numbers; + } + + protected function getVoice(): VoiceList + { + if (!$this->_voice) { + $this->_voice = new VoiceList($this); + } + return $this->_voice; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryContext.php new file mode 100644 index 0000000..b6f613b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryContext.php @@ -0,0 +1,83 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Trunking/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryInstance.php new file mode 100644 index 0000000..42eca36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), + 'originatingCallPrices' => Values::array_get($payload, 'originating_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryList.php new file mode 100644 index 0000000..e3d6883 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Trunking/Countries'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + '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 CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryPage.php new file mode 100644 index 0000000..051ddf3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V2\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberContext.php new file mode 100644 index 0000000..d09cb65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberContext.php @@ -0,0 +1,92 @@ +solution = [ + 'destinationNumber' => + $destinationNumber, + ]; + + $this->uri = '/Trunking/Numbers/' . \rawurlencode($destinationNumber) + .''; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'OriginationNumber' => + $options['originationNumber'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['destinationNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberInstance.php new file mode 100644 index 0000000..1eb2cdf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'destinationNumber' => Values::array_get($payload, 'destination_number'), + 'originationNumber' => Values::array_get($payload, 'origination_number'), + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), + 'originatingCallPrice' => Values::array_get($payload, 'originating_call_price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['destinationNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberList.php new file mode 100644 index 0000000..570e71d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $destinationNumber + + ): NumberContext + { + return new NumberContext( + $this->version, + $destinationNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberOptions.php new file mode 100644 index 0000000..0f175e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberOptions.php @@ -0,0 +1,76 @@ +options['originationNumber'] = $originationNumber; + } + + /** + * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * + * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * @return $this Fluent Builder + */ + public function setOriginationNumber(string $originationNumber): self + { + $this->options['originationNumber'] = $originationNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberPage.php new file mode 100644 index 0000000..91dcbf7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V2\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php new file mode 100644 index 0000000..80be399 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php @@ -0,0 +1,83 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php new file mode 100644 index 0000000..b1fbfdf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), + 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php new file mode 100644 index 0000000..28d0f2c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Voice/Countries'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + '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 CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php new file mode 100644 index 0000000..1d11d2d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V2\Voice\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php new file mode 100644 index 0000000..8f5d463 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php @@ -0,0 +1,92 @@ +solution = [ + 'destinationNumber' => + $destinationNumber, + ]; + + $this->uri = '/Voice/Numbers/' . \rawurlencode($destinationNumber) + .''; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'OriginationNumber' => + $options['originationNumber'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['destinationNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php new file mode 100644 index 0000000..d37951c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'destinationNumber' => Values::array_get($payload, 'destination_number'), + 'originationNumber' => Values::array_get($payload, 'origination_number'), + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundCallPrices' => Values::array_get($payload, 'outbound_call_prices'), + 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['destinationNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php new file mode 100644 index 0000000..7147366 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $destinationNumber + + ): NumberContext + { + return new NumberContext( + $this->version, + $destinationNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php new file mode 100644 index 0000000..e6f29b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php @@ -0,0 +1,76 @@ +options['originationNumber'] = $originationNumber; + } + + /** + * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * + * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * @return $this Fluent Builder + */ + public function setOriginationNumber(string $originationNumber): self + { + $this->options['originationNumber'] = $originationNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php new file mode 100644 index 0000000..997264b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V2\Voice\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php new file mode 100644 index 0000000..af1d298 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.VoiceInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php new file mode 100644 index 0000000..e8c5797 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the numbers + */ + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList( + $this->version + ); + } + return $this->_numbers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Pricing.V2.VoiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php new file mode 100644 index 0000000..c72a199 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoiceInstance \Twilio\Rest\Pricing\V2\VoiceInstance + */ + public function buildInstance(array $payload): VoiceInstance + { + return new VoiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.VoicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/PricingBase.php b/vendor/twilio/sdk/src/Twilio/Rest/PricingBase.php new file mode 100644 index 0000000..a8e2565 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/PricingBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://pricing.twilio.com'; + } + + + /** + * @return V1 Version v1 of pricing + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of pricing + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Pricing]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy.php new file mode 100644 index 0000000..e9d0a12 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy.php @@ -0,0 +1,25 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Proxy\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Proxy\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1.php new file mode 100644 index 0000000..0977a74 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Proxy.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php new file mode 100644 index 0000000..ddcaebb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php @@ -0,0 +1,134 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php new file mode 100644 index 0000000..1773e71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php @@ -0,0 +1,167 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'url' => Values::array_get($payload, 'url'), + 'isReserved' => Values::array_get($payload, 'is_reserved'), + 'inUse' => Values::array_get($payload, 'in_use'), + ]; + + $this->solution = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php new file mode 100644 index 0000000..f47569a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php @@ -0,0 +1,203 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sid' => + $options['sid'], + 'PhoneNumber' => + $options['phoneNumber'], + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + '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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php new file mode 100644 index 0000000..c58ff2b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php @@ -0,0 +1,170 @@ +options['sid'] = $sid; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['isReserved'] = $isReserved; + } + + /** + * The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. + * + * @param string $sid The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. + * @return $this Fluent Builder + */ + public function setSid(string $sid): self + { + $this->options['sid'] = $sid; + return $this; + } + + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * + * @param string $phoneNumber The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreatePhoneNumberOptions ' . $options . ']'; + } +} + + + + +class UpdatePhoneNumberOptions extends Options + { + /** + * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + */ + public function __construct( + + bool $isReserved = Values::BOOL_NONE + + ) { + $this->options['isReserved'] = $isReserved; + } + + /** + * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdatePhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php new file mode 100644 index 0000000..9a5e549 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Proxy\V1\Service\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php new file mode 100644 index 0000000..05798e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php @@ -0,0 +1,109 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Interactions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InteractionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.InteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php new file mode 100644 index 0000000..cbc3a3e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php @@ -0,0 +1,168 @@ +properties = [ + '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 = ['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 InteractionContext Context for this InteractionInstance + */ + protected function proxy(): InteractionContext + { + if (!$this->context) { + $this->context = new InteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InteractionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.InteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php new file mode 100644 index 0000000..80f1677 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Interactions'; + } + + /** + * Reads InteractionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InteractionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InteractionPage Page of InteractionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionPage + { + + $params = Values::of([ + '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 InteractionPage Page of InteractionInstance + */ + public function getPage(string $targetUrl): InteractionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Interaction resource to delete. + */ + public function getContext( + string $sid + + ): InteractionContext + { + return new InteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.InteractionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php new file mode 100644 index 0000000..8b093fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionInstance \Twilio\Rest\Proxy\V1\Service\Session\InteractionInstance + */ + public function buildInstance(array $payload): InteractionInstance + { + return new InteractionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.InteractionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php new file mode 100644 index 0000000..b12e479 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php @@ -0,0 +1,101 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/MessageInteractions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the MessageInteractionInstance + * + * @return MessageInteractionInstance Fetched MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInteractionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.MessageInteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php new file mode 100644 index 0000000..aee7ce5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 MessageInteractionContext Context for this MessageInteractionInstance + */ + protected function proxy(): MessageInteractionContext + { + 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 the MessageInteractionInstance + * + * @return MessageInteractionInstance Fetched MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInteractionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.MessageInteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php new file mode 100644 index 0000000..16ae522 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/MessageInteractions'; + } + + /** + * Create the MessageInteractionInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInteractionInstance Created MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInteractionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'MediaUrl' => + Serialize::map($options['mediaUrl'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInteractionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['participantSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 MessageInteractionPage Page of MessageInteractionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessageInteractionPage + { + + $params = Values::of([ + '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 MessageInteractionPage Page of MessageInteractionInstance + */ + public function getPage(string $targetUrl): MessageInteractionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessageInteractionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageInteractionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the MessageInteraction resource to fetch. + */ + public function getContext( + string $sid + + ): MessageInteractionContext + { + 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(): string + { + return '[Twilio.Proxy.V1.MessageInteractionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php new file mode 100644 index 0000000..35d817a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php @@ -0,0 +1,98 @@ +options['body'] = $body; + $this->options['mediaUrl'] = $mediaUrl; + } + + /** + * The message to send to the participant + * + * @param string $body The message to send to the participant + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * Reserved. Not currently supported. + * + * @param string[] $mediaUrl Reserved. Not currently supported. + * @return $this Fluent Builder + */ + public function setMediaUrl(array $mediaUrl): self + { + $this->options['mediaUrl'] = $mediaUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateMessageInteractionOptions ' . $options . ']'; + } +} + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php new file mode 100644 index 0000000..d3be5f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInteractionInstance \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionInstance + */ + public function buildInstance(array $payload): MessageInteractionInstance + { + 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(): string + { + return '[Twilio.Proxy.V1.MessageInteractionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php new file mode 100644 index 0000000..205e912 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php @@ -0,0 +1,169 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the messageInteractions + */ + protected function getMessageInteractions(): MessageInteractionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php new file mode 100644 index 0000000..09433ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php @@ -0,0 +1,167 @@ +properties = [ + '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 = ['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 ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the messageInteractions + */ + protected function getMessageInteractions(): MessageInteractionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php new file mode 100644 index 0000000..906f9d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php @@ -0,0 +1,213 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param string $identifier The phone number of the Participant. + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identifier, array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identifier' => + $identifier, + 'FriendlyName' => + $options['friendlyName'], + 'ProxyIdentifier' => + $options['proxyIdentifier'], + 'ProxyIdentifierSid' => + $options['proxyIdentifierSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + '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 ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Participant resource to delete. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php new file mode 100644 index 0000000..6201afe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php @@ -0,0 +1,118 @@ +options['friendlyName'] = $friendlyName; + $this->options['proxyIdentifier'] = $proxyIdentifier; + $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; + } + + /** + * The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** + * + * @param string $friendlyName The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. + * + * @param string $proxyIdentifier The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. + * @return $this Fluent Builder + */ + public function setProxyIdentifier(string $proxyIdentifier): self + { + $this->options['proxyIdentifier'] = $proxyIdentifier; + return $this; + } + + /** + * The SID of the Proxy Identifier to assign to the Participant. + * + * @param string $proxyIdentifierSid The SID of the Proxy Identifier to assign to the Participant. + * @return $this Fluent Builder + */ + public function setProxyIdentifierSid(string $proxyIdentifierSid): self + { + $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateParticipantOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php new file mode 100644 index 0000000..e25e916 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Proxy\V1\Service\Session\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php new file mode 100644 index 0000000..f28d8b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SessionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SessionInstance + * + * @return SessionInstance Fetched SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SessionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Updated SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SessionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateExpiry' => + Serialize::iso8601DateTime($options['dateExpiry']), + 'Ttl' => + $options['ttl'], + 'Status' => + $options['status'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the interactions + */ + protected function getInteractions(): InteractionList + { + if (!$this->_interactions) { + $this->_interactions = new InteractionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_interactions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.SessionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionInstance.php new file mode 100644 index 0000000..d71fc14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionInstance.php @@ -0,0 +1,195 @@ +properties = [ + '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 = ['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 SessionContext Context for this SessionInstance + */ + protected function proxy(): SessionContext + { + if (!$this->context) { + $this->context = new SessionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SessionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SessionInstance + * + * @return SessionInstance Fetched SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SessionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Updated SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SessionInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the interactions + */ + protected function getInteractions(): InteractionList + { + return $this->proxy()->interactions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.SessionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionList.php new file mode 100644 index 0000000..3284ae3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionList.php @@ -0,0 +1,209 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions'; + } + + /** + * Create the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Created SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SessionInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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); }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SessionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SessionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SessionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SessionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SessionPage Page of SessionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SessionPage + { + + $params = Values::of([ + '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 SessionPage Page of SessionInstance + */ + public function getPage(string $targetUrl): SessionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SessionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SessionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Session resource to delete. + */ + public function getContext( + string $sid + + ): SessionContext + { + return new SessionContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.SessionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionOptions.php new file mode 100644 index 0000000..f19a986 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionOptions.php @@ -0,0 +1,254 @@ +options['uniqueName'] = $uniqueName; + $this->options['dateExpiry'] = $dateExpiry; + $this->options['ttl'] = $ttl; + $this->options['mode'] = $mode; + $this->options['status'] = $status; + $this->options['participants'] = $participants; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @return $this Fluent Builder + */ + public function setDateExpiry(\DateTime $dateExpiry): self + { + $this->options['dateExpiry'] = $dateExpiry; + return $this; + } + + /** + * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * @param string $mode + * @return $this Fluent Builder + */ + public function setMode(string $mode): self + { + $this->options['mode'] = $mode; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The Participant objects to include in the new session. + * + * @param array[] $participants The Participant objects to include in the new session. + * @return $this Fluent Builder + */ + public function setParticipants(array $participants): self + { + $this->options['participants'] = $participants; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateSessionOptions ' . $options . ']'; + } +} + + + + +class UpdateSessionOptions extends Options + { + /** + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @param string $status + */ + public function __construct( + + \DateTime $dateExpiry = null, + int $ttl = Values::INT_NONE, + string $status = Values::NONE + + ) { + $this->options['dateExpiry'] = $dateExpiry; + $this->options['ttl'] = $ttl; + $this->options['status'] = $status; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @return $this Fluent Builder + */ + public function setDateExpiry(\DateTime $dateExpiry): self + { + $this->options['dateExpiry'] = $dateExpiry; + return $this; + } + + /** + * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateSessionOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionPage.php new file mode 100644 index 0000000..413c2e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/SessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SessionInstance \Twilio\Rest\Proxy\V1\Service\SessionInstance + */ + public function buildInstance(array $payload): SessionInstance + { + return new SessionInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.SessionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php new file mode 100644 index 0000000..29120d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php @@ -0,0 +1,134 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php new file mode 100644 index 0000000..fa31cc2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php @@ -0,0 +1,163 @@ +properties = [ + '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' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'url' => Values::array_get($payload, 'url'), + 'isReserved' => Values::array_get($payload, 'is_reserved'), + ]; + + $this->solution = ['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 ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php new file mode 100644 index 0000000..214b023 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes'; + } + + /** + * Create the ShortCodeInstance + * + * @param string $sid The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. + * @return ShortCodeInstance Created ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sid): ShortCodeInstance + { + + $data = Values::of([ + 'Sid' => + $sid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ShortCodePage Page of ShortCodeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + + $params = Values::of([ + '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 ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to delete. + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ShortCodeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php new file mode 100644 index 0000000..9b66909 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php @@ -0,0 +1,84 @@ +options['isReserved'] = $isReserved; + } + + /** + * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateShortCodeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php new file mode 100644 index 0000000..e365fe7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Proxy\V1\Service\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ShortCodePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceContext.php new file mode 100644 index 0000000..a9f3a88 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceContext.php @@ -0,0 +1,236 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'DefaultTtl' => + $options['defaultTtl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'GeoMatchLevel' => + $options['geoMatchLevel'], + 'NumberSelectionBehavior' => + $options['numberSelectionBehavior'], + 'InterceptCallbackUrl' => + $options['interceptCallbackUrl'], + 'OutOfSessionCallbackUrl' => + $options['outOfSessionCallbackUrl'], + 'ChatInstanceSid' => + $options['chatInstanceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the sessions + */ + protected function getSessions(): SessionList + { + if (!$this->_sessions) { + $this->_sessions = new SessionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sessions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceInstance.php new file mode 100644 index 0000000..5691999 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceInstance.php @@ -0,0 +1,199 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatInstanceSid' => Values::array_get($payload, 'chat_instance_sid'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'defaultTtl' => Values::array_get($payload, 'default_ttl'), + 'numberSelectionBehavior' => Values::array_get($payload, 'number_selection_behavior'), + 'geoMatchLevel' => Values::array_get($payload, 'geo_match_level'), + 'interceptCallbackUrl' => Values::array_get($payload, 'intercept_callback_url'), + 'outOfSessionCallbackUrl' => Values::array_get($payload, 'out_of_session_callback_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the sessions + */ + protected function getSessions(): SessionList + { + return $this->proxy()->sessions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceList.php new file mode 100644 index 0000000..e98a77b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceList.php @@ -0,0 +1,205 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'DefaultTtl' => + $options['defaultTtl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'GeoMatchLevel' => + $options['geoMatchLevel'], + 'NumberSelectionBehavior' => + $options['numberSelectionBehavior'], + 'InterceptCallbackUrl' => + $options['interceptCallbackUrl'], + 'OutOfSessionCallbackUrl' => + $options['outOfSessionCallbackUrl'], + 'ChatInstanceSid' => + $options['chatInstanceSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceOptions.php new file mode 100644 index 0000000..2ea4c42 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServiceOptions.php @@ -0,0 +1,360 @@ +options['defaultTtl'] = $defaultTtl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['geoMatchLevel'] = $geoMatchLevel; + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + $this->options['chatInstanceSid'] = $chatInstanceSid; + } + + /** + * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @return $this Fluent Builder + */ + public function setDefaultTtl(int $defaultTtl): self + { + $this->options['defaultTtl'] = $defaultTtl; + return $this; + } + + /** + * The URL we should call when the interaction status changes. + * + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $geoMatchLevel + * @return $this Fluent Builder + */ + public function setGeoMatchLevel(string $geoMatchLevel): self + { + $this->options['geoMatchLevel'] = $geoMatchLevel; + return $this; + } + + /** + * @param string $numberSelectionBehavior + * @return $this Fluent Builder + */ + public function setNumberSelectionBehavior(string $numberSelectionBehavior): self + { + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + return $this; + } + + /** + * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @return $this Fluent Builder + */ + public function setInterceptCallbackUrl(string $interceptCallbackUrl): self + { + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + return $this; + } + + /** + * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @return $this Fluent Builder + */ + public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self + { + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + return $this; + } + + /** + * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * @return $this Fluent Builder + */ + public function setChatInstanceSid(string $chatInstanceSid): self + { + $this->options['chatInstanceSid'] = $chatInstanceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @param string $geoMatchLevel + * @param string $numberSelectionBehavior + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + */ + public function __construct( + + string $uniqueName = Values::NONE, + int $defaultTtl = Values::INT_NONE, + string $callbackUrl = Values::NONE, + string $geoMatchLevel = Values::NONE, + string $numberSelectionBehavior = Values::NONE, + string $interceptCallbackUrl = Values::NONE, + string $outOfSessionCallbackUrl = Values::NONE, + string $chatInstanceSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['defaultTtl'] = $defaultTtl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['geoMatchLevel'] = $geoMatchLevel; + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + $this->options['chatInstanceSid'] = $chatInstanceSid; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @return $this Fluent Builder + */ + public function setDefaultTtl(int $defaultTtl): self + { + $this->options['defaultTtl'] = $defaultTtl; + return $this; + } + + /** + * The URL we should call when the interaction status changes. + * + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $geoMatchLevel + * @return $this Fluent Builder + */ + public function setGeoMatchLevel(string $geoMatchLevel): self + { + $this->options['geoMatchLevel'] = $geoMatchLevel; + return $this; + } + + /** + * @param string $numberSelectionBehavior + * @return $this Fluent Builder + */ + public function setNumberSelectionBehavior(string $numberSelectionBehavior): self + { + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + return $this; + } + + /** + * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @return $this Fluent Builder + */ + public function setInterceptCallbackUrl(string $interceptCallbackUrl): self + { + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + return $this; + } + + /** + * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @return $this Fluent Builder + */ + public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self + { + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + return $this; + } + + /** + * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * @return $this Fluent Builder + */ + public function setChatInstanceSid(string $chatInstanceSid): self + { + $this->options['chatInstanceSid'] = $chatInstanceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServicePage.php new file mode 100644 index 0000000..ffd1de1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Proxy/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Proxy\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ProxyBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ProxyBase.php new file mode 100644 index 0000000..ab4df62 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ProxyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://proxy.twilio.com'; + } + + + /** + * @return V1 Version v1 of proxy + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Proxy]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes.php new file mode 100644 index 0000000..d85f7a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes.php @@ -0,0 +1,58 @@ +phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Routes\V2\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v2->phoneNumbers instead."; + return $this->v2->phoneNumbers; + } + + /** + * @deprecated Use v2->phoneNumbers(\$phoneNumber) instead. + * @param string $phoneNumber The phone number + */ + protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Routes\V2\PhoneNumberContext { + echo "phoneNumbers(\$phoneNumber) is deprecated. Use v2->phoneNumbers(\$phoneNumber) instead."; + return $this->v2->phoneNumbers($phoneNumber); + } + + /** + * @deprecated Use v2->sipDomains instead. + */ + protected function getSipDomains(): \Twilio\Rest\Routes\V2\SipDomainList { + echo "sipDomains is deprecated. Use v2->sipDomains instead."; + return $this->v2->sipDomains; + } + + /** + * @deprecated Use v2->sipDomains(\$sipDomain) instead. + * @param string $sipDomain The sip_domain + */ + protected function contextSipDomains(string $sipDomain): \Twilio\Rest\Routes\V2\SipDomainContext { + echo "sipDomains(\$sipDomain) is deprecated. Use v2->sipDomains(\$sipDomain) instead."; + return $this->v2->sipDomains($sipDomain); + } + + /** + * @deprecated Use v2->trunks instead. + */ + protected function getTrunks(): \Twilio\Rest\Routes\V2\TrunkList { + echo "trunks is deprecated. Use v2->trunks instead."; + return $this->v2->trunks; + } + + /** + * @deprecated Use v2->trunks(\$sipTrunkDomain instead. + * @param string $sipTrunkDomain The SIP Trunk + */ + protected function contextTrunks(string $sipTrunkDomain): \Twilio\Rest\Routes\V2\TrunkContext { + echo "trunks(\$sipTrunkDomain) is deprecated. Use v2->trunks(\$sipTrunkDomain instead."; + return $this->v2->trunks($sipTrunkDomain); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2.php new file mode 100644 index 0000000..31a2429 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2.php @@ -0,0 +1,119 @@ +version = 'v2'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + protected function getSipDomains(): SipDomainList + { + if (!$this->_sipDomains) { + $this->_sipDomains = new SipDomainList($this); + } + return $this->_sipDomains; + } + + protected function getTrunks(): TrunkList + { + if (!$this->_trunks) { + $this->_trunks = new TrunkList($this); + } + return $this->_trunks; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Routes.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php new file mode 100644 index 0000000..f4d4941 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php @@ -0,0 +1,114 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberInstance.php new file mode 100644 index 0000000..928b00d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberList.php new file mode 100644 index 0000000..cba3374 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number in E.164 format + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberOptions.php new file mode 100644 index 0000000..0e3a6cd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The Inbound Processing Region used for this phone number for voice + * + * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdatePhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberPage.php new file mode 100644 index 0000000..737b943 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Routes\V2\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainContext.php new file mode 100644 index 0000000..8c19ef4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainContext.php @@ -0,0 +1,114 @@ +solution = [ + 'sipDomain' => + $sipDomain, + ]; + + $this->uri = '/SipDomains/' . \rawurlencode($sipDomain) + .''; + } + + /** + * Fetch the SipDomainInstance + * + * @return SipDomainInstance Fetched SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SipDomainInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SipDomainInstance( + $this->version, + $payload, + $this->solution['sipDomain'] + ); + } + + + /** + * Update the SipDomainInstance + * + * @param array|Options $options Optional Arguments + * @return SipDomainInstance Updated SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SipDomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SipDomainInstance( + $this->version, + $payload, + $this->solution['sipDomain'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.SipDomainContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainInstance.php new file mode 100644 index 0000000..3337a11 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'sipDomain' => Values::array_get($payload, 'sip_domain'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sipDomain' => $sipDomain ?: $this->properties['sipDomain'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SipDomainContext Context for this SipDomainInstance + */ + protected function proxy(): SipDomainContext + { + if (!$this->context) { + $this->context = new SipDomainContext( + $this->version, + $this->solution['sipDomain'] + ); + } + + return $this->context; + } + + /** + * Fetch the SipDomainInstance + * + * @return SipDomainInstance Fetched SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SipDomainInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SipDomainInstance + * + * @param array|Options $options Optional Arguments + * @return SipDomainInstance Updated SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SipDomainInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.SipDomainInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainList.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainList.php new file mode 100644 index 0000000..9475e58 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a SipDomainContext + * + * @param string $sipDomain + */ + public function getContext( + string $sipDomain + + ): SipDomainContext + { + return new SipDomainContext( + $this->version, + $sipDomain + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.SipDomainList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php new file mode 100644 index 0000000..c081b9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $voiceRegion + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdateSipDomainOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainPage.php new file mode 100644 index 0000000..790724c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SipDomainInstance \Twilio\Rest\Routes\V2\SipDomainInstance + */ + public function buildInstance(array $payload): SipDomainInstance + { + return new SipDomainInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.SipDomainPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkContext.php new file mode 100644 index 0000000..5f6b83b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkContext.php @@ -0,0 +1,114 @@ +solution = [ + 'sipTrunkDomain' => + $sipTrunkDomain, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($sipTrunkDomain) + .''; + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sipTrunkDomain'] + ); + } + + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sipTrunkDomain'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.TrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkInstance.php new file mode 100644 index 0000000..465791c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'sipTrunkDomain' => Values::array_get($payload, 'sip_trunk_domain'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sipTrunkDomain' => $sipTrunkDomain ?: $this->properties['sipTrunkDomain'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrunkContext Context for this TrunkInstance + */ + protected function proxy(): TrunkContext + { + if (!$this->context) { + $this->context = new TrunkContext( + $this->version, + $this->solution['sipTrunkDomain'] + ); + } + + return $this->context; + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.TrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkList.php new file mode 100644 index 0000000..a247a84 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a TrunkContext + * + * @param string $sipTrunkDomain The absolute URL of the SIP Trunk + */ + public function getContext( + string $sipTrunkDomain + + ): TrunkContext + { + return new TrunkContext( + $this->version, + $sipTrunkDomain + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.TrunkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkOptions.php new file mode 100644 index 0000000..548c523 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The Inbound Processing Region used for this SIP Trunk for voice + * + * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdateTrunkOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkPage.php new file mode 100644 index 0000000..b640d30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Routes/V2/TrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrunkInstance \Twilio\Rest\Routes\V2\TrunkInstance + */ + public function buildInstance(array $payload): TrunkInstance + { + return new TrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.TrunkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/RoutesBase.php b/vendor/twilio/sdk/src/Twilio/Rest/RoutesBase.php new file mode 100644 index 0000000..6ca5083 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/RoutesBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://routes.twilio.com'; + } + + + /** + * @return V2 Version v2 of routes + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Routes]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless.php new file mode 100644 index 0000000..d2512d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless.php @@ -0,0 +1,24 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Serverless\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Serverless\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1.php new file mode 100644 index 0000000..1472720 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Serverless.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php new file mode 100644 index 0000000..8dcc4ed --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php @@ -0,0 +1,95 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'assetSid' => + $assetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($assetSid) + .'/Versions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AssetVersionInstance + * + * @return AssetVersionInstance Fetched AssetVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetVersionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AssetVersionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php new file mode 100644 index 0000000..407b394 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'assetSid' => Values::array_get($payload, 'asset_sid'), + 'path' => Values::array_get($payload, 'path'), + 'visibility' => Values::array_get($payload, 'visibility'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssetVersionContext Context for this AssetVersionInstance + */ + protected function proxy(): AssetVersionContext + { + if (!$this->context) { + $this->context = new AssetVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AssetVersionInstance + * + * @return AssetVersionInstance Fetched AssetVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetVersionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php new file mode 100644 index 0000000..8dabd0b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'assetSid' => + $assetSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($assetSid) + .'/Versions'; + } + + /** + * Reads AssetVersionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssetVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssetVersionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssetVersionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssetVersionPage Page of AssetVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssetVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssetVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssetVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssetVersionPage Page of AssetVersionInstance + */ + public function getPage(string $targetUrl): AssetVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssetVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssetVersionContext + * + * @param string $sid The SID of the Asset Version resource to fetch. + */ + public function getContext( + string $sid + + ): AssetVersionContext + { + return new AssetVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetVersionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php new file mode 100644 index 0000000..1293e65 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssetVersionInstance \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionInstance + */ + public function buildInstance(array $payload): AssetVersionInstance + { + return new AssetVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetVersionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php new file mode 100644 index 0000000..e40a2ea --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php @@ -0,0 +1,189 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AssetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the AssetInstance + * + * @return AssetInstance Fetched AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Updated AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): AssetInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the assetVersions + */ + protected function getAssetVersions(): AssetVersionList + { + if (!$this->_assetVersions) { + $this->_assetVersions = new AssetVersionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_assetVersions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php new file mode 100644 index 0000000..19ca863 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 AssetContext Context for this AssetInstance + */ + protected function proxy(): AssetContext + { + if (!$this->context) { + $this->context = new AssetContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssetInstance + * + * @return AssetInstance Fetched AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Updated AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): AssetInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the assetVersions + */ + protected function getAssetVersions(): AssetVersionList + { + return $this->proxy()->assetVersions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php new file mode 100644 index 0000000..e07820a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets'; + } + + /** + * Create the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Created AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): AssetInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads AssetInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssetInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssetInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssetInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssetPage Page of AssetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssetPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssetPage Page of AssetInstance + */ + public function getPage(string $targetUrl): AssetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssetContext + * + * @param string $sid The SID that identifies the Asset resource to delete. + */ + public function getContext( + string $sid + + ): AssetContext + { + return new AssetContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php new file mode 100644 index 0000000..8bef94e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssetInstance \Twilio\Rest\Serverless\V1\Service\AssetInstance + */ + public function buildInstance(array $payload): AssetInstance + { + return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php new file mode 100644 index 0000000..7049169 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php @@ -0,0 +1,89 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds/' . \rawurlencode($sid) + .'/Status'; + } + + /** + * Fetch the BuildStatusInstance + * + * @return BuildStatusInstance Fetched BuildStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildStatusInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BuildStatusInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildStatusContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php new file mode 100644 index 0000000..8db8f45 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BuildStatusContext Context for this BuildStatusInstance + */ + protected function proxy(): BuildStatusContext + { + if (!$this->context) { + $this->context = new BuildStatusContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BuildStatusInstance + * + * @return BuildStatusInstance Fetched BuildStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildStatusInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildStatusInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php new file mode 100644 index 0000000..c704341 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php @@ -0,0 +1,73 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a BuildStatusContext + */ + public function getContext( + + ): BuildStatusContext + { + return new BuildStatusContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildStatusList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php new file mode 100644 index 0000000..b2181c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BuildStatusInstance \Twilio\Rest\Serverless\V1\Service\Build\BuildStatusInstance + */ + public function buildInstance(array $payload): BuildStatusInstance + { + return new BuildStatusInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildStatusPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php new file mode 100644 index 0000000..fc734a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php @@ -0,0 +1,162 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BuildInstance + * + * @return BuildInstance Fetched BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BuildInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the buildStatus + */ + protected function getBuildStatus(): BuildStatusList + { + if (!$this->_buildStatus) { + $this->_buildStatus = new BuildStatusList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_buildStatus; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php new file mode 100644 index 0000000..013535d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php @@ -0,0 +1,163 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'status' => Values::array_get($payload, 'status'), + 'assetVersions' => Values::array_get($payload, 'asset_versions'), + 'functionVersions' => Values::array_get($payload, 'function_versions'), + 'dependencies' => Values::array_get($payload, 'dependencies'), + 'runtime' => Values::array_get($payload, 'runtime'), + '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 = ['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 BuildContext Context for this BuildInstance + */ + protected function proxy(): BuildContext + { + if (!$this->context) { + $this->context = new BuildContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BuildInstance + * + * @return BuildInstance Fetched BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the buildStatus + */ + protected function getBuildStatus(): BuildStatusList + { + return $this->proxy()->buildStatus; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php new file mode 100644 index 0000000..5653682 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds'; + } + + /** + * Create the BuildInstance + * + * @param array|Options $options Optional Arguments + * @return BuildInstance Created BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): BuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AssetVersions' => + Serialize::map($options['assetVersions'], function ($e) { return $e; }), + 'FunctionVersions' => + Serialize::map($options['functionVersions'], function ($e) { return $e; }), + 'Dependencies' => + $options['dependencies'], + 'Runtime' => + $options['runtime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BuildInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads BuildInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BuildInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BuildInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BuildInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BuildPage Page of BuildInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BuildPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BuildPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BuildInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BuildPage Page of BuildInstance + */ + public function getPage(string $targetUrl): BuildPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BuildPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BuildContext + * + * @param string $sid The SID of the Build resource to delete. + */ + public function getContext( + string $sid + + ): BuildContext + { + return new BuildContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php new file mode 100644 index 0000000..d3d1143 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php @@ -0,0 +1,137 @@ +options['assetVersions'] = $assetVersions; + $this->options['functionVersions'] = $functionVersions; + $this->options['dependencies'] = $dependencies; + $this->options['runtime'] = $runtime; + } + + /** + * The list of Asset Version resource SIDs to include in the Build. + * + * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. + * @return $this Fluent Builder + */ + public function setAssetVersions(array $assetVersions): self + { + $this->options['assetVersions'] = $assetVersions; + return $this; + } + + /** + * The list of the Function Version resource SIDs to include in the Build. + * + * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. + * @return $this Fluent Builder + */ + public function setFunctionVersions(array $functionVersions): self + { + $this->options['functionVersions'] = $functionVersions; + return $this; + } + + /** + * A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. + * + * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. + * @return $this Fluent Builder + */ + public function setDependencies(string $dependencies): self + { + $this->options['dependencies'] = $dependencies; + return $this; + } + + /** + * The Runtime version that will be used to run the Build resource when it is deployed. + * + * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. + * @return $this Fluent Builder + */ + public function setRuntime(string $runtime): self + { + $this->options['runtime'] = $runtime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateBuildOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php new file mode 100644 index 0000000..a6b6750 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BuildInstance \Twilio\Rest\Serverless\V1\Service\BuildInstance + */ + public function buildInstance(array $payload): BuildInstance + { + return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php new file mode 100644 index 0000000..63e4717 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php @@ -0,0 +1,95 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Deployments/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.DeploymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php new file mode 100644 index 0000000..8f2e6eb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeploymentContext Context for this DeploymentInstance + */ + protected function proxy(): DeploymentContext + { + if (!$this->context) { + $this->context = new DeploymentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.DeploymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php new file mode 100644 index 0000000..1e780d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php @@ -0,0 +1,206 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Deployments'; + } + + /** + * Create the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Created DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BuildSid' => + $options['buildSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DeploymentPage Page of DeploymentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeploymentPage + { + + $params = Values::of([ + '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 DeploymentPage Page of DeploymentInstance + */ + public function getPage(string $targetUrl): DeploymentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeploymentContext + * + * @param string $sid The SID that identifies the Deployment resource to fetch. + */ + public function getContext( + string $sid + + ): DeploymentContext + { + return new DeploymentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.DeploymentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php new file mode 100644 index 0000000..7e6be28 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php @@ -0,0 +1,80 @@ +options['buildSid'] = $buildSid; + } + + /** + * The SID of the Build for the Deployment. + * + * @param string $buildSid The SID of the Build for the Deployment. + * @return $this Fluent Builder + */ + public function setBuildSid(string $buildSid): self + { + $this->options['buildSid'] = $buildSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateDeploymentOptions ' . $options . ']'; + } +} + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php new file mode 100644 index 0000000..d82d856 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeploymentInstance \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentInstance + */ + public function buildInstance(array $payload): DeploymentInstance + { + return new DeploymentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.DeploymentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php new file mode 100644 index 0000000..2ef779e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php @@ -0,0 +1,95 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Logs/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the LogInstance + * + * @return LogInstance Fetched LogInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LogInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new LogInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.LogContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php new file mode 100644 index 0000000..7cc0b3d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'requestSid' => Values::array_get($payload, 'request_sid'), + 'level' => Values::array_get($payload, 'level'), + 'message' => Values::array_get($payload, 'message'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return LogContext Context for this LogInstance + */ + protected function proxy(): LogContext + { + if (!$this->context) { + $this->context = new LogContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the LogInstance + * + * @return LogInstance Fetched LogInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LogInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.LogInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php new file mode 100644 index 0000000..983658c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php @@ -0,0 +1,187 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Logs'; + } + + /** + * Reads LogInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LogInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams LogInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LogInstance 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 LogPage Page of LogInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LogPage + { + $options = new Values($options); + + $params = Values::of([ + 'FunctionSid' => + $options['functionSid'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LogPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LogInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LogPage Page of LogInstance + */ + public function getPage(string $targetUrl): LogPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LogPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a LogContext + * + * @param string $sid The SID of the Log resource to fetch. + */ + public function getContext( + string $sid + + ): LogContext + { + return new LogContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.LogList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php new file mode 100644 index 0000000..30ab789 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php @@ -0,0 +1,114 @@ +options['functionSid'] = $functionSid; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * The SID of the function whose invocation produced the Log resources to read. + * + * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. + * @return $this Fluent Builder + */ + public function setFunctionSid(string $functionSid): self + { + $this->options['functionSid'] = $functionSid; + return $this; + } + + /** + * The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. + * + * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. + * + * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.ReadLogOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php new file mode 100644 index 0000000..074ff00 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LogInstance \Twilio\Rest\Serverless\V1\Service\Environment\LogInstance + */ + public function buildInstance(array $payload): LogInstance + { + return new LogInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.LogPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php new file mode 100644 index 0000000..9c40c8d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Variables/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the VariableInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the VariableInstance + * + * @return VariableInstance Fetched VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VariableInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the VariableInstance + * + * @param array|Options $options Optional Arguments + * @return VariableInstance Updated VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): VariableInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Key' => + $options['key'], + 'Value' => + $options['value'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.VariableContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php new file mode 100644 index 0000000..7357485 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'key' => Values::array_get($payload, 'key'), + 'value' => Values::array_get($payload, 'value'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VariableContext Context for this VariableInstance + */ + protected function proxy(): VariableContext + { + if (!$this->context) { + $this->context = new VariableContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the VariableInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the VariableInstance + * + * @return VariableInstance Fetched VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VariableInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the VariableInstance + * + * @param array|Options $options Optional Arguments + * @return VariableInstance Updated VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): VariableInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.VariableInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php new file mode 100644 index 0000000..ceded14 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php @@ -0,0 +1,206 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Variables'; + } + + /** + * Create the VariableInstance + * + * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * @return VariableInstance Created VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): VariableInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'] + ); + } + + + /** + * Reads VariableInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return VariableInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams VariableInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VariableInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return VariablePage Page of VariableInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VariablePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new VariablePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of VariableInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return VariablePage Page of VariableInstance + */ + public function getPage(string $targetUrl): VariablePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new VariablePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a VariableContext + * + * @param string $sid The SID of the Variable resource to delete. + */ + public function getContext( + string $sid + + ): VariableContext + { + return new VariableContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.VariableList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php new file mode 100644 index 0000000..7f0840a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php @@ -0,0 +1,102 @@ +options['key'] = $key; + $this->options['value'] = $value; + } + + /** + * A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * + * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * @return $this Fluent Builder + */ + public function setKey(string $key): self + { + $this->options['key'] = $key; + return $this; + } + + /** + * A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * + * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * @return $this Fluent Builder + */ + public function setValue(string $value): self + { + $this->options['value'] = $value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.UpdateVariableOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php new file mode 100644 index 0000000..f16a49c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VariableInstance \Twilio\Rest\Serverless\V1\Service\Environment\VariableInstance + */ + public function buildInstance(array $payload): VariableInstance + { + return new VariableInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.VariablePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php new file mode 100644 index 0000000..ada5cfd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EnvironmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the EnvironmentInstance + * + * @return EnvironmentInstance Fetched EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EnvironmentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EnvironmentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the logs + */ + protected function getLogs(): LogList + { + if (!$this->_logs) { + $this->_logs = new LogList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_logs; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + if (!$this->_deployments) { + $this->_deployments = new DeploymentList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_deployments; + } + + /** + * Access the variables + */ + protected function getVariables(): VariableList + { + if (!$this->_variables) { + $this->_variables = new VariableList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_variables; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.EnvironmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php new file mode 100644 index 0000000..c4cc8bc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'domainSuffix' => Values::array_get($payload, 'domain_suffix'), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 EnvironmentContext Context for this EnvironmentInstance + */ + protected function proxy(): EnvironmentContext + { + if (!$this->context) { + $this->context = new EnvironmentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EnvironmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EnvironmentInstance + * + * @return EnvironmentInstance Fetched EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EnvironmentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the logs + */ + protected function getLogs(): LogList + { + return $this->proxy()->logs; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + return $this->proxy()->deployments; + } + + /** + * Access the variables + */ + protected function getVariables(): VariableList + { + return $this->proxy()->variables; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.EnvironmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php new file mode 100644 index 0000000..f4be23c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments'; + } + + /** + * Create the EnvironmentInstance + * + * @param string $uniqueName A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. + * @param array|Options $options Optional Arguments + * @return EnvironmentInstance Created EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): EnvironmentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'DomainSuffix' => + $options['domainSuffix'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EnvironmentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads EnvironmentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EnvironmentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EnvironmentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EnvironmentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EnvironmentPage Page of EnvironmentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EnvironmentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EnvironmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EnvironmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EnvironmentPage Page of EnvironmentInstance + */ + public function getPage(string $targetUrl): EnvironmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EnvironmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EnvironmentContext + * + * @param string $sid The SID of the Environment resource to delete. + */ + public function getContext( + string $sid + + ): EnvironmentContext + { + return new EnvironmentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.EnvironmentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php new file mode 100644 index 0000000..a6de4f2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php @@ -0,0 +1,82 @@ +options['domainSuffix'] = $domainSuffix; + } + + /** + * A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. + * + * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. + * @return $this Fluent Builder + */ + public function setDomainSuffix(string $domainSuffix): self + { + $this->options['domainSuffix'] = $domainSuffix; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateEnvironmentOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php new file mode 100644 index 0000000..0e868ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EnvironmentInstance \Twilio\Rest\Serverless\V1\Service\EnvironmentInstance + */ + public function buildInstance(array $payload): EnvironmentInstance + { + return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.EnvironmentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php new file mode 100644 index 0000000..df37d21 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php @@ -0,0 +1,189 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FunctionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FunctionInstance + * + * @return FunctionInstance Fetched FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Updated FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): FunctionInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the functionVersions + */ + protected function getFunctionVersions(): FunctionVersionList + { + if (!$this->_functionVersions) { + $this->_functionVersions = new FunctionVersionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_functionVersions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php new file mode 100644 index 0000000..893889f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 FunctionContext Context for this FunctionInstance + */ + protected function proxy(): FunctionContext + { + if (!$this->context) { + $this->context = new FunctionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FunctionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FunctionInstance + * + * @return FunctionInstance Fetched FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Updated FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): FunctionInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the functionVersions + */ + protected function getFunctionVersions(): FunctionVersionList + { + return $this->proxy()->functionVersions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php new file mode 100644 index 0000000..d289e92 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions'; + } + + /** + * Create the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Created FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): FunctionInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads FunctionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FunctionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FunctionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FunctionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FunctionPage Page of FunctionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FunctionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FunctionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FunctionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FunctionPage Page of FunctionInstance + */ + public function getPage(string $targetUrl): FunctionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FunctionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FunctionContext + * + * @param string $sid The SID of the Function resource to delete. + */ + public function getContext( + string $sid + + ): FunctionContext + { + return new FunctionContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php new file mode 100644 index 0000000..be7731f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionInstance \Twilio\Rest\Serverless\V1\Service\FunctionInstance + */ + public function buildInstance(array $payload): FunctionInstance + { + return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php new file mode 100644 index 0000000..17a1df3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php @@ -0,0 +1,95 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'functionSid' => + $functionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions/' . \rawurlencode($sid) + .'/Content'; + } + + /** + * Fetch the FunctionVersionContentInstance + * + * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionContentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FunctionVersionContentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php new file mode 100644 index 0000000..5f504d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'content' => Values::array_get($payload, 'content'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FunctionVersionContentContext Context for this FunctionVersionContentInstance + */ + protected function proxy(): FunctionVersionContentContext + { + if (!$this->context) { + $this->context = new FunctionVersionContentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FunctionVersionContentInstance + * + * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionContentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php new file mode 100644 index 0000000..34b755f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php @@ -0,0 +1,79 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'functionSid' => + $functionSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a FunctionVersionContentContext + */ + public function getContext( + + ): FunctionVersionContentContext + { + return new FunctionVersionContentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionContentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php new file mode 100644 index 0000000..b530e7e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionVersionContentInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentInstance + */ + public function buildInstance(array $payload): FunctionVersionContentInstance + { + return new FunctionVersionContentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionContentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php new file mode 100644 index 0000000..fa25ba4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php @@ -0,0 +1,155 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'functionSid' => + $functionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the FunctionVersionInstance + * + * @return FunctionVersionInstance Fetched FunctionVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FunctionVersionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the functionVersionContent + */ + protected function getFunctionVersionContent(): FunctionVersionContentList + { + if (!$this->_functionVersionContent) { + $this->_functionVersionContent = new FunctionVersionContentList( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->_functionVersionContent; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php new file mode 100644 index 0000000..2d25e1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'path' => Values::array_get($payload, 'path'), + 'visibility' => Values::array_get($payload, 'visibility'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FunctionVersionContext Context for this FunctionVersionInstance + */ + protected function proxy(): FunctionVersionContext + { + if (!$this->context) { + $this->context = new FunctionVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FunctionVersionInstance + * + * @return FunctionVersionInstance Fetched FunctionVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the functionVersionContent + */ + protected function getFunctionVersionContent(): FunctionVersionContentList + { + return $this->proxy()->functionVersionContent; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php new file mode 100644 index 0000000..8e5b0b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'functionSid' => + $functionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions'; + } + + /** + * Reads FunctionVersionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FunctionVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FunctionVersionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FunctionVersionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FunctionVersionPage Page of FunctionVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FunctionVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FunctionVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FunctionVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FunctionVersionPage Page of FunctionVersionInstance + */ + public function getPage(string $targetUrl): FunctionVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FunctionVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FunctionVersionContext + * + * @param string $sid The SID of the Function Version resource to fetch. + */ + public function getContext( + string $sid + + ): FunctionVersionContext + { + return new FunctionVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php new file mode 100644 index 0000000..dd34213 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionVersionInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionInstance + */ + public function buildInstance(array $payload): FunctionVersionInstance + { + return new FunctionVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php new file mode 100644 index 0000000..9b40532 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php @@ -0,0 +1,246 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IncludeCredentials' => + Serialize::booleanToString($options['includeCredentials']), + 'FriendlyName' => + $options['friendlyName'], + 'UiEditable' => + Serialize::booleanToString($options['uiEditable']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the functions + */ + protected function getFunctions(): FunctionList + { + if (!$this->_functions) { + $this->_functions = new FunctionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_functions; + } + + /** + * Access the builds + */ + protected function getBuilds(): BuildList + { + if (!$this->_builds) { + $this->_builds = new BuildList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_builds; + } + + /** + * Access the environments + */ + protected function getEnvironments(): EnvironmentList + { + if (!$this->_environments) { + $this->_environments = new EnvironmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_environments; + } + + /** + * Access the assets + */ + protected function getAssets(): AssetList + { + if (!$this->_assets) { + $this->_assets = new AssetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_assets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php new file mode 100644 index 0000000..4807e22 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'includeCredentials' => Values::array_get($payload, 'include_credentials'), + 'uiEditable' => Values::array_get($payload, 'ui_editable'), + 'domainBase' => Values::array_get($payload, 'domain_base'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the functions + */ + protected function getFunctions(): FunctionList + { + return $this->proxy()->functions; + } + + /** + * Access the builds + */ + protected function getBuilds(): BuildList + { + return $this->proxy()->builds; + } + + /** + * Access the environments + */ + protected function getEnvironments(): EnvironmentList + { + return $this->proxy()->environments; + } + + /** + * Access the assets + */ + protected function getAssets(): AssetList + { + return $this->proxy()->assets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php new file mode 100644 index 0000000..40af2d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php @@ -0,0 +1,199 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $uniqueName A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique. + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $friendlyName, + 'IncludeCredentials' => + Serialize::booleanToString($options['includeCredentials']), + 'UiEditable' => + Serialize::booleanToString($options['uiEditable']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The `sid` or `unique_name` of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php new file mode 100644 index 0000000..40c5953 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php @@ -0,0 +1,188 @@ +options['includeCredentials'] = $includeCredentials; + $this->options['uiEditable'] = $uiEditable; + } + + /** + * Whether to inject Account credentials into a function invocation context. The default value is `true`. + * + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. + * @return $this Fluent Builder + */ + public function setIncludeCredentials(bool $includeCredentials): self + { + $this->options['includeCredentials'] = $includeCredentials; + return $this; + } + + /** + * Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. + * + * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. + * @return $this Fluent Builder + */ + public function setUiEditable(bool $uiEditable): self + { + $this->options['uiEditable'] = $uiEditable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + */ + public function __construct( + + bool $includeCredentials = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + bool $uiEditable = Values::BOOL_NONE + + ) { + $this->options['includeCredentials'] = $includeCredentials; + $this->options['friendlyName'] = $friendlyName; + $this->options['uiEditable'] = $uiEditable; + } + + /** + * Whether to inject Account credentials into a function invocation context. + * + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. + * @return $this Fluent Builder + */ + public function setIncludeCredentials(bool $includeCredentials): self + { + $this->options['includeCredentials'] = $includeCredentials; + return $this; + } + + /** + * A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + * + * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + * @return $this Fluent Builder + */ + public function setUiEditable(bool $uiEditable): self + { + $this->options['uiEditable'] = $uiEditable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php new file mode 100644 index 0000000..c6ff80b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Serverless\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/ServerlessBase.php b/vendor/twilio/sdk/src/Twilio/Rest/ServerlessBase.php new file mode 100644 index 0000000..010fb53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/ServerlessBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://serverless.twilio.com'; + } + + + /** + * @return V1 Version v1 of serverless + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Serverless]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio.php new file mode 100644 index 0000000..6d0984c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio.php @@ -0,0 +1,32 @@ +flows instead. + */ + protected function getFlows(): \Twilio\Rest\Studio\V2\FlowList { + echo "flows is deprecated. Use v2->flows instead."; + return $this->v2->flows; + } + + /** + * @deprecated Use v2->flows(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFlows(string $sid): \Twilio\Rest\Studio\V2\FlowContext { + echo "flows(\$sid) is deprecated. Use v2->flows(\$sid) instead."; + return $this->v2->flows($sid); + } + + /** + * @deprecated Use v2->flowValidate instead. + */ + protected function getFlowValidate(): \Twilio\Rest\Studio\V2\FlowValidateList { + echo "flowValidate is deprecated. Use v2->flowValidate instead."; + return $this->v2->flowValidate; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1.php new file mode 100644 index 0000000..99ac82d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getFlows(): FlowList + { + if (!$this->_flows) { + $this->_flows = new FlowList($this); + } + return $this->_flows; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Studio.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php new file mode 100644 index 0000000..9f9a1ff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php @@ -0,0 +1,89 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Context'; + } + + /** + * Fetch the EngagementContextInstance + * + * @return EngagementContextInstance Fetched EngagementContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EngagementContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php new file mode 100644 index 0000000..5606e27 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EngagementContextContext Context for this EngagementContextInstance + */ + protected function proxy(): EngagementContextContext + { + if (!$this->context) { + $this->context = new EngagementContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EngagementContextInstance + * + * @return EngagementContextInstance Fetched EngagementContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php new file mode 100644 index 0000000..f4484fc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + ]; + } + + /** + * Constructs a EngagementContextContext + */ + public function getContext( + + ): EngagementContextContext + { + return new EngagementContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php new file mode 100644 index 0000000..5b59b7f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EngagementContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextInstance + */ + public function buildInstance(array $payload): EngagementContextInstance + { + return new EngagementContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php new file mode 100644 index 0000000..1dfd859 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php @@ -0,0 +1,95 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the StepContextInstance + * + * @return StepContextInstance Fetched StepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new StepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php new file mode 100644 index 0000000..6a4247c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StepContextContext Context for this StepContextInstance + */ + protected function proxy(): StepContextContext + { + if (!$this->context) { + $this->context = new StepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StepContextInstance + * + * @return StepContextInstance Fetched StepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php new file mode 100644 index 0000000..d319942 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a StepContextContext + */ + public function getContext( + + ): StepContextContext + { + return new StepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php new file mode 100644 index 0000000..9112c84 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StepContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextInstance + */ + public function buildInstance(array $payload): StepContextInstance + { + return new StepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php new file mode 100644 index 0000000..d943d29 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php @@ -0,0 +1,155 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the StepInstance + * + * @return StepInstance Fetched StepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new StepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): StepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new StepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php new file mode 100644 index 0000000..021f01f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 StepContext Context for this StepInstance + */ + protected function proxy(): StepContext + { + if (!$this->context) { + $this->context = new StepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StepInstance + * + * @return StepInstance Fetched StepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): StepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php new file mode 100644 index 0000000..7c19779 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 StepPage Page of StepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): StepPage + { + + $params = Values::of([ + '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 StepPage Page of StepInstance + */ + public function getPage(string $targetUrl): StepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new StepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a StepContext + * + * @param string $sid The SID of the Step resource to fetch. + */ + public function getContext( + string $sid + + ): StepContext + { + return new StepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php new file mode 100644 index 0000000..90704fc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StepInstance \Twilio\Rest\Studio\V1\Flow\Engagement\StepInstance + */ + public function buildInstance(array $payload): StepInstance + { + return new StepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php new file mode 100644 index 0000000..9d14b66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php @@ -0,0 +1,182 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EngagementInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the EngagementInstance + * + * @return EngagementInstance Fetched EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EngagementInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): StepList + { + if (!$this->_steps) { + $this->_steps = new StepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the engagementContext + */ + protected function getEngagementContext(): EngagementContextList + { + if (!$this->_engagementContext) { + $this->_engagementContext = new EngagementContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_engagementContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php new file mode 100644 index 0000000..c6f6624 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactSid' => Values::array_get($payload, 'contact_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 EngagementContext Context for this EngagementInstance + */ + protected function proxy(): EngagementContext + { + if (!$this->context) { + $this->context = new EngagementContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EngagementInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EngagementInstance + * + * @return EngagementInstance Fetched EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the steps + */ + protected function getSteps(): StepList + { + return $this->proxy()->steps; + } + + /** + * Access the engagementContext + */ + protected function getEngagementContext(): EngagementContextList + { + return $this->proxy()->engagementContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php new file mode 100644 index 0000000..540dcb4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php @@ -0,0 +1,205 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements'; + } + + /** + * Create the EngagementInstance + * + * @param string $to The Contact phone number to start a Studio Flow Engagement, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow Engagement. Available as variable `{{flow.channel.address}}` + * @param array|Options $options Optional Arguments + * @return EngagementInstance Created EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): EngagementInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EngagementInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 EngagementPage Page of EngagementInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EngagementPage + { + + $params = Values::of([ + '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 EngagementPage Page of EngagementInstance + */ + public function getPage(string $targetUrl): EngagementPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EngagementPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EngagementContext + * + * @param string $sid The SID of the Engagement resource to delete. + */ + public function getContext( + string $sid + + ): EngagementContext + { + return new EngagementContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php new file mode 100644 index 0000000..4e7b7ed --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php @@ -0,0 +1,82 @@ +options['parameters'] = $parameters; + } + + /** + * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. + * + * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.CreateEngagementOptions ' . $options . ']'; + } +} + + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php new file mode 100644 index 0000000..ed850a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EngagementInstance \Twilio\Rest\Studio\V1\Flow\EngagementInstance + */ + public function buildInstance(array $payload): EngagementInstance + { + return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php new file mode 100644 index 0000000..c049ecd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php @@ -0,0 +1,89 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Context'; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php new file mode 100644 index 0000000..1c3d0bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContextContext Context for this ExecutionContextInstance + */ + protected function proxy(): ExecutionContextContext + { + if (!$this->context) { + $this->context = new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php new file mode 100644 index 0000000..f94b429 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + } + + /** + * Constructs a ExecutionContextContext + */ + public function getContext( + + ): ExecutionContextContext + { + return new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php new file mode 100644 index 0000000..00459dd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextInstance + */ + public function buildInstance(array $payload): ExecutionContextInstance + { + return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php new file mode 100644 index 0000000..1db2867 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -0,0 +1,95 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionStepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php new file mode 100644 index 0000000..685945a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance + */ + protected function proxy(): ExecutionStepContextContext + { + if (!$this->context) { + $this->context = new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php new file mode 100644 index 0000000..79beff4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a ExecutionStepContextContext + */ + public function getContext( + + ): ExecutionStepContextContext + { + return new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php new file mode 100644 index 0000000..be9205f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextInstance + */ + public function buildInstance(array $payload): ExecutionStepContextInstance + { + return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php new file mode 100644 index 0000000..1f857bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php @@ -0,0 +1,155 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionStepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new ExecutionStepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php new file mode 100644 index 0000000..6e9e9a8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContext Context for this ExecutionStepInstance + */ + protected function proxy(): ExecutionStepContext + { + if (!$this->context) { + $this->context = new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php new file mode 100644 index 0000000..02f0b5a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps'; + } + + /** + * Reads ExecutionStepInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionStepInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExecutionStepInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionStepPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function getPage(string $targetUrl): ExecutionStepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionStepContext + * + * @param string $sid The SID of the ExecutionStep resource to fetch. + */ + public function getContext( + string $sid + + ): ExecutionStepContext + { + return new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php new file mode 100644 index 0000000..5bb6fdc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepInstance + */ + public function buildInstance(array $payload): ExecutionStepInstance + { + return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php new file mode 100644 index 0000000..9efd03b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php @@ -0,0 +1,209 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + if (!$this->_steps) { + $this->_steps = new ExecutionStepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + if (!$this->_executionContext) { + $this->_executionContext = new ExecutionContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_executionContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php new file mode 100644 index 0000000..4a0307e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php @@ -0,0 +1,184 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactSid' => Values::array_get($payload, 'contact_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 ExecutionContext Context for this ExecutionInstance + */ + protected function proxy(): ExecutionContext + { + if (!$this->context) { + $this->context = new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + return $this->proxy()->steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + return $this->proxy()->executionContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php new file mode 100644 index 0000000..881ea95 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php @@ -0,0 +1,213 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions'; + } + + /** + * Create the ExecutionInstance + * + * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. + * @param array|Options $options Optional Arguments + * @return ExecutionInstance Created ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): ExecutionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * Reads ExecutionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ExecutionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionInstance 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 ExecutionPage Page of ExecutionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedFrom' => + Serialize::iso8601DateTime($options['dateCreatedFrom']), + 'DateCreatedTo' => + Serialize::iso8601DateTime($options['dateCreatedTo']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionPage Page of ExecutionInstance + */ + public function getPage(string $targetUrl): ExecutionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionContext + * + * @param string $sid The SID of the Execution resource to delete. + */ + public function getContext( + string $sid + + ): ExecutionContext + { + return new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php new file mode 100644 index 0000000..7008176 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php @@ -0,0 +1,152 @@ +options['parameters'] = $parameters; + } + + /** + * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * + * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.CreateExecutionOptions ' . $options . ']'; + } +} + + + +class ReadExecutionOptions extends Options + { + /** + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + */ + public function __construct( + + \DateTime $dateCreatedFrom = null, + \DateTime $dateCreatedTo = null + + ) { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + $this->options['dateCreatedTo'] = $dateCreatedTo; + } + + /** + * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self + { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + return $this; + } + + /** + * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedTo(\DateTime $dateCreatedTo): self + { + $this->options['dateCreatedTo'] = $dateCreatedTo; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.ReadExecutionOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php new file mode 100644 index 0000000..15deb40 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionInstance \Twilio\Rest\Studio\V1\Flow\ExecutionInstance + */ + public function buildInstance(array $payload): ExecutionInstance + { + return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowContext.php new file mode 100644 index 0000000..1052d60 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowContext.php @@ -0,0 +1,174 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the engagements + */ + protected function getEngagements(): EngagementList + { + if (!$this->_engagements) { + $this->_engagements = new EngagementList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_engagements; + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + if (!$this->_executions) { + $this->_executions = new ExecutionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_executions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.FlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php new file mode 100644 index 0000000..be6ee3b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php @@ -0,0 +1,165 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowContext Context for this FlowInstance + */ + protected function proxy(): FlowContext + { + if (!$this->context) { + $this->context = new FlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the engagements + */ + protected function getEngagements(): EngagementList + { + return $this->proxy()->engagements; + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + return $this->proxy()->executions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.FlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowList.php new file mode 100644 index 0000000..599cd23 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Flows'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 FlowPage Page of FlowInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowPage + { + + $params = Values::of([ + '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 FlowPage Page of FlowInstance + */ + public function getPage(string $targetUrl): FlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowContext + * + * @param string $sid The SID of the Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlowContext + { + return new FlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.FlowList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowPage.php new file mode 100644 index 0000000..d9213f9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V1/FlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowInstance \Twilio\Rest\Studio\V1\FlowInstance + */ + public function buildInstance(array $payload): FlowInstance + { + return new FlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.FlowPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2.php new file mode 100644 index 0000000..e24fa86 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2.php @@ -0,0 +1,106 @@ +version = 'v2'; + } + + protected function getFlows(): FlowList + { + if (!$this->_flows) { + $this->_flows = new FlowList($this); + } + return $this->_flows; + } + + protected function getFlowValidate(): FlowValidateList + { + if (!$this->_flowValidate) { + $this->_flowValidate = new FlowValidateList($this); + } + return $this->_flowValidate; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Studio.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php new file mode 100644 index 0000000..c93ba96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php @@ -0,0 +1,89 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Context'; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php new file mode 100644 index 0000000..eaa4a1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContextContext Context for this ExecutionContextInstance + */ + protected function proxy(): ExecutionContextContext + { + if (!$this->context) { + $this->context = new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php new file mode 100644 index 0000000..81fd0d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + } + + /** + * Constructs a ExecutionContextContext + */ + public function getContext( + + ): ExecutionContextContext + { + return new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php new file mode 100644 index 0000000..2e47ddc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextInstance + */ + public function buildInstance(array $payload): ExecutionContextInstance + { + return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php new file mode 100644 index 0000000..dcb6f7e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -0,0 +1,95 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionStepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php new file mode 100644 index 0000000..bbea47a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance + */ + protected function proxy(): ExecutionStepContextContext + { + if (!$this->context) { + $this->context = new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php new file mode 100644 index 0000000..b58f6e5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a ExecutionStepContextContext + */ + public function getContext( + + ): ExecutionStepContextContext + { + return new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepContextList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php new file mode 100644 index 0000000..f794190 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextInstance + */ + public function buildInstance(array $payload): ExecutionStepContextInstance + { + return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepContextPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php new file mode 100644 index 0000000..efcbb29 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php @@ -0,0 +1,155 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionStepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new ExecutionStepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php new file mode 100644 index 0000000..69a0f99 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContext Context for this ExecutionStepInstance + */ + protected function proxy(): ExecutionStepContext + { + if (!$this->context) { + $this->context = new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php new file mode 100644 index 0000000..438c32b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps'; + } + + /** + * Reads ExecutionStepInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionStepInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExecutionStepInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionStepPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function getPage(string $targetUrl): ExecutionStepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionStepContext + * + * @param string $sid The SID of the ExecutionStep resource to fetch. + */ + public function getContext( + string $sid + + ): ExecutionStepContext + { + return new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php new file mode 100644 index 0000000..aa3f6af --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepInstance + */ + public function buildInstance(array $payload): ExecutionStepInstance + { + return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php new file mode 100644 index 0000000..16ef115 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php @@ -0,0 +1,209 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + if (!$this->_steps) { + $this->_steps = new ExecutionStepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + if (!$this->_executionContext) { + $this->_executionContext = new ExecutionContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_executionContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php new file mode 100644 index 0000000..19a1a9c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php @@ -0,0 +1,182 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 ExecutionContext Context for this ExecutionInstance + */ + protected function proxy(): ExecutionContext + { + if (!$this->context) { + $this->context = new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + return $this->proxy()->steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + return $this->proxy()->executionContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionList.php new file mode 100644 index 0000000..14ab9c7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionList.php @@ -0,0 +1,213 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions'; + } + + /** + * Create the ExecutionInstance + * + * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. + * @param array|Options $options Optional Arguments + * @return ExecutionInstance Created ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): ExecutionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * Reads ExecutionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ExecutionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionInstance 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 ExecutionPage Page of ExecutionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedFrom' => + Serialize::iso8601DateTime($options['dateCreatedFrom']), + 'DateCreatedTo' => + Serialize::iso8601DateTime($options['dateCreatedTo']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionPage Page of ExecutionInstance + */ + public function getPage(string $targetUrl): ExecutionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionContext + * + * @param string $sid The SID of the Execution resource to delete. + */ + public function getContext( + string $sid + + ): ExecutionContext + { + return new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php new file mode 100644 index 0000000..a8a71d2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php @@ -0,0 +1,152 @@ +options['parameters'] = $parameters; + } + + /** + * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * + * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.CreateExecutionOptions ' . $options . ']'; + } +} + + + +class ReadExecutionOptions extends Options + { + /** + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + */ + public function __construct( + + \DateTime $dateCreatedFrom = null, + \DateTime $dateCreatedTo = null + + ) { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + $this->options['dateCreatedTo'] = $dateCreatedTo; + } + + /** + * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self + { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + return $this; + } + + /** + * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedTo(\DateTime $dateCreatedTo): self + { + $this->options['dateCreatedTo'] = $dateCreatedTo; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.ReadExecutionOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php new file mode 100644 index 0000000..e2a247f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionInstance \Twilio\Rest\Studio\V2\Flow\ExecutionInstance + */ + public function buildInstance(array $payload): ExecutionInstance + { + return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php new file mode 100644 index 0000000..0529a91 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php @@ -0,0 +1,89 @@ +solution = [ + 'sid' => + $sid, + 'revision' => + $revision, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/Revisions/' . \rawurlencode($revision) + .''; + } + + /** + * Fetch the FlowRevisionInstance + * + * @return FlowRevisionInstance Fetched FlowRevisionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowRevisionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlowRevisionInstance( + $this->version, + $payload, + $this->solution['sid'], + $this->solution['revision'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowRevisionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php new file mode 100644 index 0000000..1224f69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'definition' => Values::array_get($payload, 'definition'), + 'status' => Values::array_get($payload, 'status'), + 'revision' => Values::array_get($payload, 'revision'), + 'commitMessage' => Values::array_get($payload, 'commit_message'), + 'valid' => Values::array_get($payload, 'valid'), + 'errors' => Values::array_get($payload, 'errors'), + '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 = ['sid' => $sid, 'revision' => $revision ?: $this->properties['revision'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowRevisionContext Context for this FlowRevisionInstance + */ + protected function proxy(): FlowRevisionContext + { + if (!$this->context) { + $this->context = new FlowRevisionContext( + $this->version, + $this->solution['sid'], + $this->solution['revision'] + ); + } + + return $this->context; + } + + /** + * Fetch the FlowRevisionInstance + * + * @return FlowRevisionInstance Fetched FlowRevisionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowRevisionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowRevisionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php new file mode 100644 index 0000000..83e7aef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php @@ -0,0 +1,168 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/Revisions'; + } + + /** + * Reads FlowRevisionInstance 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 FlowRevisionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FlowRevisionInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlowRevisionInstance 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 FlowRevisionPage Page of FlowRevisionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowRevisionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlowRevisionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlowRevisionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlowRevisionPage Page of FlowRevisionInstance + */ + public function getPage(string $targetUrl): FlowRevisionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowRevisionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowRevisionContext + * + * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. + */ + public function getContext( + string $revision + + ): FlowRevisionContext + { + return new FlowRevisionContext( + $this->version, + $this->solution['sid'], + $revision + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowRevisionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php new file mode 100644 index 0000000..e424df9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowRevisionInstance \Twilio\Rest\Studio\V2\Flow\FlowRevisionInstance + */ + public function buildInstance(array $payload): FlowRevisionInstance + { + return new FlowRevisionInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowRevisionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php new file mode 100644 index 0000000..39f4a3e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php @@ -0,0 +1,110 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/TestUsers'; + } + + /** + * Fetch the FlowTestUserInstance + * + * @return FlowTestUserInstance Fetched FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowTestUserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlowTestUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlowTestUserInstance + * + * @param string[] $testUsers List of test user identities that can test draft versions of the flow. + * @return FlowTestUserInstance Updated FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $testUsers): FlowTestUserInstance + { + + $data = Values::of([ + 'TestUsers' => + Serialize::map($testUsers,function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FlowTestUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowTestUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php new file mode 100644 index 0000000..9b19926 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'testUsers' => Values::array_get($payload, 'test_users'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowTestUserContext Context for this FlowTestUserInstance + */ + protected function proxy(): FlowTestUserContext + { + if (!$this->context) { + $this->context = new FlowTestUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FlowTestUserInstance + * + * @return FlowTestUserInstance Fetched FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowTestUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlowTestUserInstance + * + * @param string[] $testUsers List of test user identities that can test draft versions of the flow. + * @return FlowTestUserInstance Updated FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $testUsers): FlowTestUserInstance + { + + return $this->proxy()->update($testUsers); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowTestUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php new file mode 100644 index 0000000..c500427 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php @@ -0,0 +1,67 @@ +solution = [ + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a FlowTestUserContext + */ + public function getContext( + + ): FlowTestUserContext + { + return new FlowTestUserContext( + $this->version, + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowTestUserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php new file mode 100644 index 0000000..b81ac40 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowTestUserInstance \Twilio\Rest\Studio\V2\Flow\FlowTestUserInstance + */ + public function buildInstance(array $payload): FlowTestUserInstance + { + return new FlowTestUserInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowTestUserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowContext.php new file mode 100644 index 0000000..1c7dad8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowContext.php @@ -0,0 +1,230 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlowInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return FlowInstance Updated FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): FlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'FriendlyName' => + $options['friendlyName'], + 'Definition' => + Serialize::jsonObject($options['definition']), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + if (!$this->_executions) { + $this->_executions = new ExecutionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_executions; + } + + /** + * Access the revisions + */ + protected function getRevisions(): FlowRevisionList + { + if (!$this->_revisions) { + $this->_revisions = new FlowRevisionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_revisions; + } + + /** + * Access the testUsers + */ + protected function getTestUsers(): FlowTestUserList + { + if (!$this->_testUsers) { + $this->_testUsers = new FlowTestUserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_testUsers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowInstance.php new file mode 100644 index 0000000..3ba2f55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowInstance.php @@ -0,0 +1,202 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'definition' => Values::array_get($payload, 'definition'), + 'status' => Values::array_get($payload, 'status'), + 'revision' => Values::array_get($payload, 'revision'), + 'commitMessage' => Values::array_get($payload, 'commit_message'), + 'valid' => Values::array_get($payload, 'valid'), + 'errors' => Values::array_get($payload, 'errors'), + 'warnings' => Values::array_get($payload, 'warnings'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowContext Context for this FlowInstance + */ + protected function proxy(): FlowContext + { + if (!$this->context) { + $this->context = new FlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlowInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return FlowInstance Updated FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): FlowInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + return $this->proxy()->executions; + } + + /** + * Access the revisions + */ + protected function getRevisions(): FlowRevisionList + { + return $this->proxy()->revisions; + } + + /** + * Access the testUsers + */ + protected function getTestUsers(): FlowTestUserList + { + return $this->proxy()->testUsers; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowList.php new file mode 100644 index 0000000..10cea53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowList.php @@ -0,0 +1,200 @@ +solution = [ + ]; + + $this->uri = '/Flows'; + } + + /** + * Create the FlowInstance + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param string $status + * @param array $definition JSON representation of flow definition. + * @param array|Options $options Optional Arguments + * @return FlowInstance Created FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $status, array $definition, array $options = []): FlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Status' => + $status, + 'Definition' => + Serialize::jsonObject($definition), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FlowInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 FlowPage Page of FlowInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowPage + { + + $params = Values::of([ + '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 FlowPage Page of FlowInstance + */ + public function getPage(string $targetUrl): FlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowContext + * + * @param string $sid The SID of the Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlowContext + { + return new FlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowOptions.php new file mode 100644 index 0000000..1068188 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowOptions.php @@ -0,0 +1,170 @@ +options['commitMessage'] = $commitMessage; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.CreateFlowOptions ' . $options . ']'; + } +} + + + + +class UpdateFlowOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param array $definition JSON representation of flow definition. + * @param string $commitMessage Description of change made in the revision. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $definition = Values::ARRAY_NONE, + string $commitMessage = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['definition'] = $definition; + $this->options['commitMessage'] = $commitMessage; + } + + /** + * The string that you assigned to describe the Flow. + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * JSON representation of flow definition. + * + * @param array $definition JSON representation of flow definition. + * @return $this Fluent Builder + */ + public function setDefinition(array $definition): self + { + $this->options['definition'] = $definition; + return $this; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.UpdateFlowOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowPage.php new file mode 100644 index 0000000..a835e84 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowInstance \Twilio\Rest\Studio\V2\FlowInstance + */ + public function buildInstance(array $payload): FlowInstance + { + return new FlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateInstance.php new file mode 100644 index 0000000..d09e5f9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'valid' => Values::array_get($payload, 'valid'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateList.php new file mode 100644 index 0000000..ef4fc66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateList.php @@ -0,0 +1,91 @@ +solution = [ + ]; + + $this->uri = '/Flows/Validate'; + } + + /** + * Update the FlowValidateInstance + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param string $status + * @param array $definition JSON representation of flow definition. + * @param array|Options $options Optional Arguments + * @return FlowValidateInstance Updated FlowValidateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, string $status, array $definition, array $options = []): FlowValidateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Status' => + $status, + 'Definition' => + Serialize::jsonObject($definition), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FlowValidateInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateOptions.php new file mode 100644 index 0000000..a167058 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidateOptions.php @@ -0,0 +1,76 @@ +options['commitMessage'] = $commitMessage; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.UpdateFlowValidateOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidatePage.php new file mode 100644 index 0000000..e8da3ff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Studio/V2/FlowValidatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowValidateInstance \Twilio\Rest\Studio\V2\FlowValidateInstance + */ + public function buildInstance(array $payload): FlowValidateInstance + { + return new FlowValidateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/StudioBase.php b/vendor/twilio/sdk/src/Twilio/Rest/StudioBase.php new file mode 100644 index 0000000..03f869b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/StudioBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://studio.twilio.com'; + } + + + /** + * @return V1 Version v1 of studio + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of studio + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Studio]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim.php new file mode 100644 index 0000000..ea41506 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim.php @@ -0,0 +1,142 @@ +esimProfiles instead. + */ + protected function getEsimProfiles(): \Twilio\Rest\Supersim\V1\EsimProfileList { + echo "esimProfiles is deprecated. Use v1->esimProfiles instead."; + return $this->v1->esimProfiles; + } + + /** + * @deprecated Use v1->esimProfiles(\$sid) instead. + * @param string $sid The SID of the eSIM Profile resource to fetch + */ + protected function contextEsimProfiles(string $sid): \Twilio\Rest\Supersim\V1\EsimProfileContext { + echo "esimProfiles(\$sid) is deprecated. Use v1->esimProfiles(\$sid) instead."; + return $this->v1->esimProfiles($sid); + } + + /** + * @deprecated Use v1->fleets instead. + */ + protected function getFleets(): \Twilio\Rest\Supersim\V1\FleetList { + echo "fleets is deprecated. Use v1->fleets instead."; + return $this->v1->fleets; + } + + /** + * @deprecated Use v1->fleets(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFleets(string $sid): \Twilio\Rest\Supersim\V1\FleetContext { + echo "fleets(\$sid) is deprecated. Use v1->fleets(\$sid) instead."; + return $this->v1->fleets($sid); + } + + /** + * @deprecated Use v1->ipCommands instead. + */ + protected function getIpCommands(): \Twilio\Rest\Supersim\V1\IpCommandList { + echo "ipCommands is deprecated. Use v1->ipCommands instead."; + return $this->v1->ipCommands; + } + + /** + * @deprecated Use v1->ipCommands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextIpCommands(string $sid): \Twilio\Rest\Supersim\V1\IpCommandContext { + echo "ipCommands(\$sid) is deprecated. Use v1->ipCommands(\$sid) instead."; + return $this->v1->ipCommands($sid); + } + + /** + * @deprecated Use v1->networks instead. + */ + protected function getNetworks(): \Twilio\Rest\Supersim\V1\NetworkList { + echo "networks is deprecated. Use v1->networks instead."; + return $this->v1->networks; + } + + /** + * @deprecated Use v1->networks(\$sid) instead. + * @param string $sid The SID of the Network resource to fetch + */ + protected function contextNetworks(string $sid): \Twilio\Rest\Supersim\V1\NetworkContext { + echo "networks(\$sid) is deprecated. Use v1->networks(\$sid) instead."; + return $this->v1->networks($sid); + } + + /** + * @deprecated Use v1->networkAccessProfiles instead. + */ + protected function getNetworkAccessProfiles(): \Twilio\Rest\Supersim\V1\NetworkAccessProfileList { + echo "networkAccessProfiles is deprecated. Use v1->networkAccessProfiles instead."; + return $this->v1->networkAccessProfiles; + } + + /** + * @deprecated Use v1->networkAccessProfiles(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextNetworkAccessProfiles(string $sid): \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext { + echo "networkAccessProfiles(\$sid) is deprecated. Use v1->networkAccessProfiles(\$sid) instead."; + return $this->v1->networkAccessProfiles($sid); + } + + /** + * @deprecated Use v1->settingsUpdates instead. + */ + protected function getSettingsUpdates(): \Twilio\Rest\Supersim\V1\SettingsUpdateList { + echo "settingsUpdates is deprecated. Use v1->settingsUpdates instead."; + return $this->v1->settingsUpdates; + } + + /** + * @deprecated Use v1->sims instead. + */ + protected function getSims(): \Twilio\Rest\Supersim\V1\SimList { + echo "sims is deprecated. Use v1->sims instead."; + return $this->v1->sims; + } + + /** + * @deprecated Use v1->sims(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextSims(string $sid): \Twilio\Rest\Supersim\V1\SimContext { + echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; + return $this->v1->sims($sid); + } + + /** + * @deprecated Use v1->smsCommands instead. + */ + protected function getSmsCommands(): \Twilio\Rest\Supersim\V1\SmsCommandList { + echo "smsCommands is deprecated. Use v1->smsCommands instead."; + return $this->v1->smsCommands; + } + + /** + * @deprecated Use v1->smsCommands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextSmsCommands(string $sid): \Twilio\Rest\Supersim\V1\SmsCommandContext { + echo "smsCommands(\$sid) is deprecated. Use v1->smsCommands(\$sid) instead."; + return $this->v1->smsCommands($sid); + } + + /** + * @deprecated Use v1->usageRecords instead. + */ + protected function getUsageRecords(): \Twilio\Rest\Supersim\V1\UsageRecordList { + echo "usageRecords is deprecated. Use v1->usageRecords instead."; + return $this->v1->usageRecords; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1.php new file mode 100644 index 0000000..ae1778d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1.php @@ -0,0 +1,189 @@ +version = 'v1'; + } + + protected function getEsimProfiles(): EsimProfileList + { + if (!$this->_esimProfiles) { + $this->_esimProfiles = new EsimProfileList($this); + } + return $this->_esimProfiles; + } + + protected function getFleets(): FleetList + { + if (!$this->_fleets) { + $this->_fleets = new FleetList($this); + } + return $this->_fleets; + } + + protected function getIpCommands(): IpCommandList + { + if (!$this->_ipCommands) { + $this->_ipCommands = new IpCommandList($this); + } + return $this->_ipCommands; + } + + protected function getNetworks(): NetworkList + { + if (!$this->_networks) { + $this->_networks = new NetworkList($this); + } + return $this->_networks; + } + + protected function getNetworkAccessProfiles(): NetworkAccessProfileList + { + if (!$this->_networkAccessProfiles) { + $this->_networkAccessProfiles = new NetworkAccessProfileList($this); + } + return $this->_networkAccessProfiles; + } + + protected function getSettingsUpdates(): SettingsUpdateList + { + if (!$this->_settingsUpdates) { + $this->_settingsUpdates = new SettingsUpdateList($this); + } + return $this->_settingsUpdates; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + protected function getSmsCommands(): SmsCommandList + { + if (!$this->_smsCommands) { + $this->_smsCommands = new SmsCommandList($this); + } + return $this->_smsCommands; + } + + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList($this); + } + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Supersim.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php new file mode 100644 index 0000000..d59229e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ESimProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EsimProfileInstance + * + * @return EsimProfileInstance Fetched EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EsimProfileInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EsimProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.EsimProfileContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileInstance.php new file mode 100644 index 0000000..df3831f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'status' => Values::array_get($payload, 'status'), + 'eid' => Values::array_get($payload, 'eid'), + 'smdpPlusAddress' => Values::array_get($payload, 'smdp_plus_address'), + 'matchingId' => Values::array_get($payload, 'matching_id'), + 'activationCode' => Values::array_get($payload, 'activation_code'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EsimProfileContext Context for this EsimProfileInstance + */ + protected function proxy(): EsimProfileContext + { + if (!$this->context) { + $this->context = new EsimProfileContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EsimProfileInstance + * + * @return EsimProfileInstance Fetched EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EsimProfileInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.EsimProfileInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileList.php new file mode 100644 index 0000000..930e4ec --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileList.php @@ -0,0 +1,207 @@ +solution = [ + ]; + + $this->uri = '/ESimProfiles'; + } + + /** + * Create the EsimProfileInstance + * + * @param array|Options $options Optional Arguments + * @return EsimProfileInstance Created EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): EsimProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + 'GenerateMatchingId' => + Serialize::booleanToString($options['generateMatchingId']), + 'Eid' => + $options['eid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EsimProfileInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EsimProfileInstance 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 EsimProfileInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EsimProfileInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EsimProfileInstance 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 EsimProfilePage Page of EsimProfileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EsimProfilePage + { + $options = new Values($options); + + $params = Values::of([ + 'Eid' => + $options['eid'], + 'SimSid' => + $options['simSid'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EsimProfilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EsimProfileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EsimProfilePage Page of EsimProfileInstance + */ + public function getPage(string $targetUrl): EsimProfilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EsimProfilePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EsimProfileContext + * + * @param string $sid The SID of the eSIM Profile resource to fetch. + */ + public function getContext( + string $sid + + ): EsimProfileContext + { + return new EsimProfileContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.EsimProfileList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.php new file mode 100644 index 0000000..51d8202 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.php @@ -0,0 +1,220 @@ +options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['generateMatchingId'] = $generateMatchingId; + $this->options['eid'] = $eid; + } + + /** + * The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. + * + * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. + * + * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. + * @return $this Fluent Builder + */ + public function setGenerateMatchingId(bool $generateMatchingId): self + { + $this->options['generateMatchingId'] = $generateMatchingId; + return $this; + } + + /** + * Identifier of the eUICC that will claim the eSIM Profile. + * + * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. + * @return $this Fluent Builder + */ + public function setEid(string $eid): self + { + $this->options['eid'] = $eid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateEsimProfileOptions ' . $options . ']'; + } +} + + +class ReadEsimProfileOptions extends Options + { + /** + * @param string $eid List the eSIM Profiles that have been associated with an EId. + * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * @param string $status List the eSIM Profiles that are in a given status. + */ + public function __construct( + + string $eid = Values::NONE, + string $simSid = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['eid'] = $eid; + $this->options['simSid'] = $simSid; + $this->options['status'] = $status; + } + + /** + * List the eSIM Profiles that have been associated with an EId. + * + * @param string $eid List the eSIM Profiles that have been associated with an EId. + * @return $this Fluent Builder + */ + public function setEid(string $eid): self + { + $this->options['eid'] = $eid; + return $this; + } + + /** + * Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * + * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * @return $this Fluent Builder + */ + public function setSimSid(string $simSid): self + { + $this->options['simSid'] = $simSid; + return $this; + } + + /** + * List the eSIM Profiles that are in a given status. + * + * @param string $status List the eSIM Profiles that are in a given status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadEsimProfileOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfilePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfilePage.php new file mode 100644 index 0000000..4979843 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/EsimProfilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EsimProfileInstance \Twilio\Rest\Supersim\V1\EsimProfileInstance + */ + public function buildInstance(array $payload): EsimProfileInstance + { + return new EsimProfileInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.EsimProfilePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetContext.php new file mode 100644 index 0000000..d0b4835 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetContext.php @@ -0,0 +1,124 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'NetworkAccessProfile' => + $options['networkAccessProfile'], + 'IpCommandsUrl' => + $options['ipCommandsUrl'], + 'IpCommandsMethod' => + $options['ipCommandsMethod'], + 'SmsCommandsUrl' => + $options['smsCommandsUrl'], + 'SmsCommandsMethod' => + $options['smsCommandsMethod'], + 'DataLimit' => + $options['dataLimit'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.FleetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetInstance.php new file mode 100644 index 0000000..93ee427 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, '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')), + 'url' => Values::array_get($payload, 'url'), + 'dataEnabled' => Values::array_get($payload, 'data_enabled'), + 'dataLimit' => Values::array_get($payload, 'data_limit'), + 'dataMetering' => Values::array_get($payload, 'data_metering'), + 'smsCommandsEnabled' => Values::array_get($payload, 'sms_commands_enabled'), + 'smsCommandsUrl' => Values::array_get($payload, 'sms_commands_url'), + 'smsCommandsMethod' => Values::array_get($payload, 'sms_commands_method'), + 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), + 'ipCommandsUrl' => Values::array_get($payload, 'ip_commands_url'), + 'ipCommandsMethod' => Values::array_get($payload, 'ip_commands_method'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FleetContext Context for this FleetInstance + */ + protected function proxy(): FleetContext + { + if (!$this->context) { + $this->context = new FleetContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.FleetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetList.php new file mode 100644 index 0000000..b949e98 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetList.php @@ -0,0 +1,214 @@ +solution = [ + ]; + + $this->uri = '/Fleets'; + } + + /** + * Create the FleetInstance + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @param array|Options $options Optional Arguments + * @return FleetInstance Created FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $networkAccessProfile, array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NetworkAccessProfile' => + $networkAccessProfile, + 'UniqueName' => + $options['uniqueName'], + 'DataEnabled' => + Serialize::booleanToString($options['dataEnabled']), + 'DataLimit' => + $options['dataLimit'], + 'IpCommandsUrl' => + $options['ipCommandsUrl'], + 'IpCommandsMethod' => + $options['ipCommandsMethod'], + 'SmsCommandsEnabled' => + Serialize::booleanToString($options['smsCommandsEnabled']), + 'SmsCommandsUrl' => + $options['smsCommandsUrl'], + 'SmsCommandsMethod' => + $options['smsCommandsMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new FleetInstance( + $this->version, + $payload + ); + } + + + /** + * 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 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 FleetInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 FleetPage Page of FleetInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FleetPage + { + $options = new Values($options); + + $params = Values::of([ + 'NetworkAccessProfile' => + $options['networkAccessProfile'], + '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 FleetPage Page of FleetInstance + */ + public function getPage(string $targetUrl): FleetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FleetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FleetContext + * + * @param string $sid The SID of the Fleet resource to fetch. + */ + public function getContext( + string $sid + + ): FleetContext + { + return new FleetContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.FleetList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetOptions.php new file mode 100644 index 0000000..fe62208 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetOptions.php @@ -0,0 +1,416 @@ +options['uniqueName'] = $uniqueName; + $this->options['dataEnabled'] = $dataEnabled; + $this->options['dataLimit'] = $dataLimit; + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. + * + * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setIpCommandsUrl(string $ipCommandsUrl): self + { + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setIpCommandsMethod(string $ipCommandsMethod): self + { + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + return $this; + } + + /** + * Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. + * + * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. + * @return $this Fluent Builder + */ + public function setSmsCommandsEnabled(bool $smsCommandsEnabled): self + { + $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setSmsCommandsUrl(string $smsCommandsUrl): self + { + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsCommandsMethod(string $smsCommandsMethod): self + { + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateFleetOptions ' . $options . ']'; + } +} + + +class ReadFleetOptions extends Options + { + /** + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + */ + public function __construct( + + string $networkAccessProfile = Values::NONE + + ) { + $this->options['networkAccessProfile'] = $networkAccessProfile; + } + + /** + * The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + * @return $this Fluent Builder + */ + public function setNetworkAccessProfile(string $networkAccessProfile): self + { + $this->options['networkAccessProfile'] = $networkAccessProfile; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadFleetOptions ' . $options . ']'; + } +} + +class UpdateFleetOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $networkAccessProfile = Values::NONE, + string $ipCommandsUrl = Values::NONE, + string $ipCommandsMethod = Values::NONE, + string $smsCommandsUrl = Values::NONE, + string $smsCommandsMethod = Values::NONE, + int $dataLimit = Values::INT_NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['networkAccessProfile'] = $networkAccessProfile; + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + $this->options['dataLimit'] = $dataLimit; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @return $this Fluent Builder + */ + public function setNetworkAccessProfile(string $networkAccessProfile): self + { + $this->options['networkAccessProfile'] = $networkAccessProfile; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setIpCommandsUrl(string $ipCommandsUrl): self + { + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setIpCommandsMethod(string $ipCommandsMethod): self + { + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setSmsCommandsUrl(string $smsCommandsUrl): self + { + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsCommandsMethod(string $smsCommandsMethod): self + { + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateFleetOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetPage.php new file mode 100644 index 0000000..d9e82f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/FleetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FleetInstance \Twilio\Rest\Supersim\V1\FleetInstance + */ + public function buildInstance(array $payload): FleetInstance + { + return new FleetInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.FleetPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandContext.php new file mode 100644 index 0000000..19c4849 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/IpCommands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the IpCommandInstance + * + * @return IpCommandInstance Fetched IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpCommandInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpCommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.IpCommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandInstance.php new file mode 100644 index 0000000..70c86fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'simIccid' => Values::array_get($payload, 'sim_iccid'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'deviceIp' => Values::array_get($payload, 'device_ip'), + 'devicePort' => Values::array_get($payload, 'device_port'), + 'payloadType' => Values::array_get($payload, 'payload_type'), + 'payload' => Values::array_get($payload, 'payload'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpCommandContext Context for this IpCommandInstance + */ + protected function proxy(): IpCommandContext + { + if (!$this->context) { + $this->context = new IpCommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the IpCommandInstance + * + * @return IpCommandInstance Fetched IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpCommandInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.IpCommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandList.php new file mode 100644 index 0000000..8b875be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandList.php @@ -0,0 +1,215 @@ +solution = [ + ]; + + $this->uri = '/IpCommands'; + } + + /** + * Create the IpCommandInstance + * + * @param string $sim The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to. + * @param string $payload The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64. + * @param int $devicePort The device port to which the IP Command will be sent. + * @param array|Options $options Optional Arguments + * @return IpCommandInstance Created IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sim, string $payload, int $devicePort, array $options = []): IpCommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sim' => + $sim, + 'Payload' => + $payload, + 'DevicePort' => + $devicePort, + 'PayloadType' => + $options['payloadType'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpCommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads IpCommandInstance 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 IpCommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams IpCommandInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpCommandInstance 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 IpCommandPage Page of IpCommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpCommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'SimIccid' => + $options['simIccid'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpCommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpCommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpCommandPage Page of IpCommandInstance + */ + public function getPage(string $targetUrl): IpCommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpCommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpCommandContext + * + * @param string $sid The SID of the IP Command resource to fetch. + */ + public function getContext( + string $sid + + ): IpCommandContext + { + return new IpCommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.IpCommandList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandOptions.php new file mode 100644 index 0000000..55c52c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandOptions.php @@ -0,0 +1,218 @@ +options['payloadType'] = $payloadType; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + } + + /** + * @param string $payloadType + * @return $this Fluent Builder + */ + public function setPayloadType(string $payloadType): self + { + $this->options['payloadType'] = $payloadType; + return $this; + } + + /** + * The URL we should call using the `callback_method` after we have sent the IP Command. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateIpCommandOptions ' . $options . ']'; + } +} + + +class ReadIpCommandOptions extends Options + { + /** + * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. + * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. + * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. + * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + */ + public function __construct( + + string $sim = Values::NONE, + string $simIccid = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['simIccid'] = $simIccid; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * The SID or unique name of the Sim resource that IP Command was sent to or from. + * + * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The ICCID of the Sim resource that IP Command was sent to or from. + * + * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSimIccid(string $simIccid): self + { + $this->options['simIccid'] = $simIccid; + return $this; + } + + /** + * The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. + * + * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * + * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadIpCommandOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandPage.php new file mode 100644 index 0000000..48a53a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/IpCommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpCommandInstance \Twilio\Rest\Supersim\V1\IpCommandInstance + */ + public function buildInstance(array $payload): IpCommandInstance + { + return new IpCommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.IpCommandPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php new file mode 100644 index 0000000..a86aeac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php @@ -0,0 +1,103 @@ +solution = [ + 'networkAccessProfileSid' => + $networkAccessProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) + .'/Networks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the NetworkAccessProfileNetworkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the NetworkAccessProfileNetworkInstance + * + * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileNetworkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NetworkAccessProfileNetworkInstance( + $this->version, + $payload, + $this->solution['networkAccessProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php new file mode 100644 index 0000000..b27a0b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'identifiers' => Values::array_get($payload, 'identifiers'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkAccessProfileNetworkContext Context for this NetworkAccessProfileNetworkInstance + */ + protected function proxy(): NetworkAccessProfileNetworkContext + { + if (!$this->context) { + $this->context = new NetworkAccessProfileNetworkContext( + $this->version, + $this->solution['networkAccessProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the NetworkAccessProfileNetworkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the NetworkAccessProfileNetworkInstance + * + * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileNetworkInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php new file mode 100644 index 0000000..656c388 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php @@ -0,0 +1,195 @@ +solution = [ + 'networkAccessProfileSid' => + $networkAccessProfileSid, + + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) + .'/Networks'; + } + + /** + * Create the NetworkAccessProfileNetworkInstance + * + * @param string $network The SID of the Network resource to be added to the Network Access Profile resource. + * @return NetworkAccessProfileNetworkInstance Created NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $network): NetworkAccessProfileNetworkInstance + { + + $data = Values::of([ + 'Network' => + $network, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NetworkAccessProfileNetworkInstance( + $this->version, + $payload, + $this->solution['networkAccessProfileSid'] + ); + } + + + /** + * Reads NetworkAccessProfileNetworkInstance 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 NetworkAccessProfileNetworkInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams NetworkAccessProfileNetworkInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkAccessProfileNetworkInstance 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 NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkAccessProfileNetworkPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkAccessProfileNetworkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance + */ + public function getPage(string $targetUrl): NetworkAccessProfileNetworkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkAccessProfileNetworkContext + * + * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. + */ + public function getContext( + string $sid + + ): NetworkAccessProfileNetworkContext + { + return new NetworkAccessProfileNetworkContext( + $this->version, + $this->solution['networkAccessProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php new file mode 100644 index 0000000..1935251 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkAccessProfileNetworkInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkInstance + */ + public function buildInstance(array $payload): NetworkAccessProfileNetworkInstance + { + return new NetworkAccessProfileNetworkInstance($this->version, $payload, $this->solution['networkAccessProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php new file mode 100644 index 0000000..dcdba8c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php @@ -0,0 +1,170 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the NetworkAccessProfileInstance + * + * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NetworkAccessProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NetworkAccessProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new NetworkAccessProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the networks + */ + protected function getNetworks(): NetworkAccessProfileNetworkList + { + if (!$this->_networks) { + $this->_networks = new NetworkAccessProfileNetworkList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_networks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php new file mode 100644 index 0000000..7af1942 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkAccessProfileContext Context for this NetworkAccessProfileInstance + */ + protected function proxy(): NetworkAccessProfileContext + { + if (!$this->context) { + $this->context = new NetworkAccessProfileContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NetworkAccessProfileInstance + * + * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NetworkAccessProfileInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the networks + */ + protected function getNetworks(): NetworkAccessProfileNetworkList + { + return $this->proxy()->networks; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php new file mode 100644 index 0000000..b936e4a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php @@ -0,0 +1,193 @@ +solution = [ + ]; + + $this->uri = '/NetworkAccessProfiles'; + } + + /** + * Create the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Created NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NetworkAccessProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Networks' => + Serialize::map($options['networks'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NetworkAccessProfileInstance( + $this->version, + $payload + ); + } + + + /** + * Reads NetworkAccessProfileInstance 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 NetworkAccessProfileInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams NetworkAccessProfileInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkAccessProfileInstance 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 NetworkAccessProfilePage Page of NetworkAccessProfileInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkAccessProfilePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkAccessProfilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkAccessProfileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance + */ + public function getPage(string $targetUrl): NetworkAccessProfilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkAccessProfilePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkAccessProfileContext + * + * @param string $sid The SID of the Network Access Profile resource to fetch. + */ + public function getContext( + string $sid + + ): NetworkAccessProfileContext + { + return new NetworkAccessProfileContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php new file mode 100644 index 0000000..a2bb769 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php @@ -0,0 +1,150 @@ +options['uniqueName'] = $uniqueName; + $this->options['networks'] = $networks; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * List of Network SIDs that this Network Access Profile will allow connections to. + * + * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. + * @return $this Fluent Builder + */ + public function setNetworks(array $networks): self + { + $this->options['networks'] = $networks; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateNetworkAccessProfileOptions ' . $options . ']'; + } +} + + + +class UpdateNetworkAccessProfileOptions extends Options + { + /** + * @param string $uniqueName The new unique name of the Network Access Profile. + */ + public function __construct( + + string $uniqueName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The new unique name of the Network Access Profile. + * + * @param string $uniqueName The new unique name of the Network Access Profile. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateNetworkAccessProfileOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php new file mode 100644 index 0000000..7848618 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkAccessProfileInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfileInstance + */ + public function buildInstance(array $payload): NetworkAccessProfileInstance + { + return new NetworkAccessProfileInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfilePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkContext.php new file mode 100644 index 0000000..9e5d1c6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Networks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the NetworkInstance + * + * @return NetworkInstance Fetched NetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new NetworkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkInstance.php new file mode 100644 index 0000000..9462d85 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'url' => Values::array_get($payload, 'url'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'identifiers' => Values::array_get($payload, 'identifiers'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkContext Context for this NetworkInstance + */ + protected function proxy(): NetworkContext + { + if (!$this->context) { + $this->context = new NetworkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NetworkInstance + * + * @return NetworkInstance Fetched NetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkList.php new file mode 100644 index 0000000..7e7d038 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkList.php @@ -0,0 +1,172 @@ +solution = [ + ]; + + $this->uri = '/Networks'; + } + + /** + * Reads NetworkInstance 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 NetworkInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams NetworkInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkInstance 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 NetworkPage Page of NetworkInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkPage + { + $options = new Values($options); + + $params = Values::of([ + 'IsoCountry' => + $options['isoCountry'], + 'Mcc' => + $options['mcc'], + 'Mnc' => + $options['mnc'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkPage Page of NetworkInstance + */ + public function getPage(string $targetUrl): NetworkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkContext + * + * @param string $sid The SID of the Network resource to fetch. + */ + public function getContext( + string $sid + + ): NetworkContext + { + return new NetworkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkOptions.php new file mode 100644 index 0000000..faf1dcc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkOptions.php @@ -0,0 +1,114 @@ +options['isoCountry'] = $isoCountry; + $this->options['mcc'] = $mcc; + $this->options['mnc'] = $mnc; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. + * + * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. + * @return $this Fluent Builder + */ + public function setMcc(string $mcc): self + { + $this->options['mcc'] = $mcc; + return $this; + } + + /** + * The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. + * + * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. + * @return $this Fluent Builder + */ + public function setMnc(string $mnc): self + { + $this->options['mnc'] = $mnc; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadNetworkOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkPage.php new file mode 100644 index 0000000..2a57c1c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/NetworkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkInstance \Twilio\Rest\Supersim\V1\NetworkInstance + */ + public function buildInstance(array $payload): NetworkInstance + { + return new NetworkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php new file mode 100644 index 0000000..2ae61d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php @@ -0,0 +1,95 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'status' => Values::array_get($payload, 'status'), + 'packages' => Values::array_get($payload, 'packages'), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateList.php new file mode 100644 index 0000000..2972375 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/SettingsUpdates'; + } + + /** + * Reads SettingsUpdateInstance 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 SettingsUpdateInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SettingsUpdateInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SettingsUpdateInstance 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 SettingsUpdatePage Page of SettingsUpdateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SettingsUpdatePage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SettingsUpdatePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SettingsUpdateInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SettingsUpdatePage Page of SettingsUpdateInstance + */ + public function getPage(string $targetUrl): SettingsUpdatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SettingsUpdatePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php new file mode 100644 index 0000000..54886fb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php @@ -0,0 +1,94 @@ +options['sim'] = $sim; + $this->options['status'] = $status; + } + + /** + * Filter the Settings Updates by a Super SIM's SID or UniqueName. + * + * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. + * + * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSettingsUpdateOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php new file mode 100644 index 0000000..e96753b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingsUpdateInstance \Twilio\Rest\Supersim\V1\SettingsUpdateInstance + */ + public function buildInstance(array $payload): SettingsUpdateInstance + { + return new SettingsUpdateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php new file mode 100644 index 0000000..04236b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php @@ -0,0 +1,96 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'periodType' => Values::array_get($payload, 'period_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php new file mode 100644 index 0000000..162e87f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/BillingPeriods'; + } + + /** + * Reads BillingPeriodInstance 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 BillingPeriodInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BillingPeriodInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BillingPeriodInstance 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 BillingPeriodPage Page of BillingPeriodInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BillingPeriodPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BillingPeriodPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BillingPeriodInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BillingPeriodPage Page of BillingPeriodInstance + */ + public function getPage(string $targetUrl): BillingPeriodPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BillingPeriodPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php new file mode 100644 index 0000000..54eae4f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BillingPeriodInstance \Twilio\Rest\Supersim\V1\Sim\BillingPeriodInstance + */ + public function buildInstance(array $payload): BillingPeriodInstance + { + return new BillingPeriodInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php new file mode 100644 index 0000000..6898f4a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php @@ -0,0 +1,83 @@ +properties = [ + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'ipAddressVersion' => Values::array_get($payload, 'ip_address_version'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php new file mode 100644 index 0000000..1b571cd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/IpAddresses'; + } + + /** + * Reads SimIpAddressInstance 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 SimIpAddressInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SimIpAddressInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimIpAddressInstance 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 SimIpAddressPage Page of SimIpAddressInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimIpAddressPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SimIpAddressPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SimIpAddressInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SimIpAddressPage Page of SimIpAddressInstance + */ + public function getPage(string $targetUrl): SimIpAddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimIpAddressPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php new file mode 100644 index 0000000..ce4f72c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimIpAddressInstance \Twilio\Rest\Supersim\V1\Sim\SimIpAddressInstance + */ + public function buildInstance(array $payload): SimIpAddressInstance + { + return new SimIpAddressInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimContext.php new file mode 100644 index 0000000..96b2427 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimContext.php @@ -0,0 +1,197 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Status' => + $options['status'], + 'Fleet' => + $options['fleet'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + 'AccountSid' => + $options['accountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the billingPeriods + */ + protected function getBillingPeriods(): BillingPeriodList + { + if (!$this->_billingPeriods) { + $this->_billingPeriods = new BillingPeriodList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_billingPeriods; + } + + /** + * Access the simIpAddresses + */ + protected function getSimIpAddresses(): SimIpAddressList + { + if (!$this->_simIpAddresses) { + $this->_simIpAddresses = new SimIpAddressList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_simIpAddresses; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimInstance.php new file mode 100644 index 0000000..067a9c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'status' => Values::array_get($payload, 'status'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the billingPeriods + */ + protected function getBillingPeriods(): BillingPeriodList + { + return $this->proxy()->billingPeriods; + } + + /** + * Access the simIpAddresses + */ + protected function getSimIpAddresses(): SimIpAddressList + { + return $this->proxy()->simIpAddresses; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimList.php new file mode 100644 index 0000000..26805a9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimList.php @@ -0,0 +1,201 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * Create the SimInstance + * + * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the Super SIM to be added to your Account. + * @param string $registrationCode The 10-digit code required to claim the Super SIM for your Account. + * @return SimInstance Created SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $iccid, string $registrationCode): SimInstance + { + + $data = Values::of([ + 'Iccid' => + $iccid, + 'RegistrationCode' => + $registrationCode, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SimInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance 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 SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'Fleet' => + $options['fleet'], + 'Iccid' => + $options['iccid'], + '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 SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid The SID of the Sim resource to fetch. + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimOptions.php new file mode 100644 index 0000000..25aa24b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimOptions.php @@ -0,0 +1,256 @@ +options['status'] = $status; + $this->options['fleet'] = $fleet; + $this->options['iccid'] = $iccid; + } + + /** + * The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. + * + * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The SID or unique name of the Fleet to which a list of Sims are assigned. + * + * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. + * + * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $status + * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. + * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $status = Values::NONE, + string $fleet = Values::NONE, + string $callbackUrl = Values::NONE, + string $callbackMethod = Values::NONE, + string $accountSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['status'] = $status; + $this->options['fleet'] = $fleet; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['accountSid'] = $accountSid; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The SID or unique name of the Fleet to which the SIM resource should be assigned. + * + * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * The URL we should call using the `callback_method` after an asynchronous update has finished. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + * + * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimPage.php new file mode 100644 index 0000000..fe77837 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Supersim\V1\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php new file mode 100644 index 0000000..3decde7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SmsCommands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SmsCommandInstance + * + * @return SmsCommandInstance Fetched SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SmsCommandInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SmsCommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SmsCommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandInstance.php new file mode 100644 index 0000000..35d7078 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'payload' => Values::array_get($payload, 'payload'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SmsCommandContext Context for this SmsCommandInstance + */ + protected function proxy(): SmsCommandContext + { + if (!$this->context) { + $this->context = new SmsCommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SmsCommandInstance + * + * @return SmsCommandInstance Fetched SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SmsCommandInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SmsCommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandList.php new file mode 100644 index 0000000..78dfd5d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/SmsCommands'; + } + + /** + * Create the SmsCommandInstance + * + * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to. + * @param string $payload The message body of the SMS Command. + * @param array|Options $options Optional Arguments + * @return SmsCommandInstance Created SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sim, string $payload, array $options = []): SmsCommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sim' => + $sim, + 'Payload' => + $payload, + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SmsCommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SmsCommandInstance 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 SmsCommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SmsCommandInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SmsCommandInstance 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 SmsCommandPage Page of SmsCommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SmsCommandPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SmsCommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SmsCommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SmsCommandPage Page of SmsCommandInstance + */ + public function getPage(string $targetUrl): SmsCommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SmsCommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SmsCommandContext + * + * @param string $sid The SID of the SMS Command resource to fetch. + */ + public function getContext( + string $sid + + ): SmsCommandContext + { + return new SmsCommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SmsCommandList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandOptions.php new file mode 100644 index 0000000..c3998d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandOptions.php @@ -0,0 +1,184 @@ +options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using the `callback_method` after we have sent the command. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateSmsCommandOptions ' . $options . ']'; + } +} + + +class ReadSmsCommandOptions extends Options + { + /** + * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. + * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + */ + public function __construct( + + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * The SID or unique name of the Sim resource that SMS Command was sent to or from. + * + * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * + * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * + * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSmsCommandOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandPage.php new file mode 100644 index 0000000..5caf9b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/SmsCommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SmsCommandInstance \Twilio\Rest\Supersim\V1\SmsCommandInstance + */ + public function buildInstance(array $payload): SmsCommandInstance + { + return new SmsCommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SmsCommandPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordInstance.php new file mode 100644 index 0000000..67d66a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'networkSid' => Values::array_get($payload, 'network_sid'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'period' => Values::array_get($payload, 'period'), + 'dataUpload' => Values::array_get($payload, 'data_upload'), + 'dataDownload' => Values::array_get($payload, 'data_download'), + 'dataTotal' => Values::array_get($payload, 'data_total'), + 'dataTotalBilled' => Values::array_get($payload, 'data_total_billed'), + 'billedUnit' => Values::array_get($payload, 'billed_unit'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.UsageRecordInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordList.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordList.php new file mode 100644 index 0000000..c0140bd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordList.php @@ -0,0 +1,167 @@ +solution = [ + ]; + + $this->uri = '/UsageRecords'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance 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 UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Fleet' => + $options['fleet'], + 'Network' => + $options['network'], + 'IsoCountry' => + $options['isoCountry'], + 'Group' => + $options['group'], + 'Granularity' => + $options['granularity'], + 'StartTime' => + Serialize::iso8601DateTime($options['startTime']), + 'EndTime' => + Serialize::iso8601DateTime($options['endTime']), + '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 UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $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(): string + { + return '[Twilio.Supersim.V1.UsageRecordList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordOptions.php new file mode 100644 index 0000000..ec5259b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordOptions.php @@ -0,0 +1,202 @@ +options['sim'] = $sim; + $this->options['fleet'] = $fleet; + $this->options['network'] = $network; + $this->options['isoCountry'] = $isoCountry; + $this->options['group'] = $group; + $this->options['granularity'] = $granularity; + $this->options['startTime'] = $startTime; + $this->options['endTime'] = $endTime; + } + + /** + * SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. + * + * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. + * + * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * SID of a Network resource. Only show UsageRecords representing usage on this network. + * + * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. + * @return $this Fluent Builder + */ + public function setNetwork(string $network): self + { + $this->options['network'] = $network; + return $this; + } + + /** + * Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. + * + * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. + * + * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. + * @return $this Fluent Builder + */ + public function setGroup(string $group): self + { + $this->options['group'] = $group; + return $this; + } + + /** + * Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. + * + * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. + * + * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. + * @return $this Fluent Builder + */ + public function setStartTime(\DateTime $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. + * + * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. + * @return $this Fluent Builder + */ + public function setEndTime(\DateTime $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordPage.php new file mode 100644 index 0000000..4ed9ccc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Supersim/V1/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Supersim\V1\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.UsageRecordPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/SupersimBase.php b/vendor/twilio/sdk/src/Twilio/Rest/SupersimBase.php new file mode 100644 index 0000000..857d847 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/SupersimBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://supersim.twilio.com'; + } + + + /** + * @return V1 Version v1 of supersim + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Supersim]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync.php new file mode 100644 index 0000000..9b72e0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync.php @@ -0,0 +1,23 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Sync\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Sync\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1.php new file mode 100644 index 0000000..b7eb372 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Sync.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php new file mode 100644 index 0000000..c9d2bf6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'documentSid' => + $documentSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. + * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php new file mode 100644 index 0000000..4954032 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 DocumentPermissionContext Context for this DocumentPermissionInstance + */ + protected function proxy(): DocumentPermissionContext + { + if (!$this->context) { + $this->context = new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. + * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php new file mode 100644 index 0000000..47800c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'documentSid' => + $documentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPermissionPage + { + + $params = Values::of([ + '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 DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function getPage(string $targetUrl): DocumentPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. + */ + public function getContext( + string $identity + + ): DocumentPermissionContext + { + return new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php new file mode 100644 index 0000000..bc06d0e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentPermissionInstance \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionInstance + */ + public function buildInstance(array $payload): DocumentPermissionInstance + { + return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php new file mode 100644 index 0000000..dce0f53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php new file mode 100644 index 0000000..2a18c07 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php @@ -0,0 +1,177 @@ +properties = [ + '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 = ['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 DocumentContext Context for this DocumentInstance + */ + protected function proxy(): DocumentContext + { + if (!$this->context) { + $this->context = new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php new file mode 100644 index 0000000..6aad582 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php @@ -0,0 +1,203 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents'; + } + + /** + * Create the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Created DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 DocumentPage Page of DocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPage + { + + $params = Values::of([ + '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 DocumentPage Page of DocumentInstance + */ + public function getPage(string $targetUrl): DocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentContext + * + * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): DocumentContext + { + return new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php new file mode 100644 index 0000000..917eeed --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php @@ -0,0 +1,206 @@ +options['uniqueName'] = $uniqueName; + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + } + + /** + * An application-defined string that uniquely identifies the Sync Document + * + * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateDocumentOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php new file mode 100644 index 0000000..2d2d811 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentInstance \Twilio\Rest\Sync\V1\Service\DocumentInstance + */ + public function buildInstance(array $payload): DocumentInstance + { + return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php new file mode 100644 index 0000000..fc8b7d7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php @@ -0,0 +1,150 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'index' => + $index, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items/' . \rawurlencode($index) + .''; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Update the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php new file mode 100644 index 0000000..b94854e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php @@ -0,0 +1,167 @@ +properties = [ + '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 = ['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 SyncListItemContext Context for this SyncListItemInstance + */ + protected function proxy(): SyncListItemContext + { + if (!$this->context) { + $this->context = new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListItemInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php new file mode 100644 index 0000000..b271b0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php @@ -0,0 +1,224 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items'; + } + + /** + * Create the SyncListItemInstance + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Created SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data, array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListItemInstance 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 SyncListItemPage Page of SyncListItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListItemPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SyncListItemPage Page of SyncListItemInstance + */ + public function getPage(string $targetUrl): SyncListItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListItemContext + * + * @param int $index The index of the Sync List Item resource to delete. + */ + public function getContext( + int $index + + ): SyncListItemContext + { + return new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $index + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListItemList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php new file mode 100644 index 0000000..f428f87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php @@ -0,0 +1,378 @@ +options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncListItemOptions ' . $options . ']'; + } +} + +class DeleteSyncListItemOptions extends Options + { + /** + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.DeleteSyncListItemOptions ' . $options . ']'; + } +} + + +class ReadSyncListItemOptions extends Options + { + /** + * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. + * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * + * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * The `index` of the first Sync List Item resource to read. See also `bounds`. + * + * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + * + * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.ReadSyncListItemOptions ' . $options . ']'; + } +} + +class UpdateSyncListItemOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + int $itemTtl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncListItemOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php new file mode 100644 index 0000000..70fa95d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListItemInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemInstance + */ + public function buildInstance(array $payload): SyncListItemInstance + { + return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListItemPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php new file mode 100644 index 0000000..4407906 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php new file mode 100644 index 0000000..43d7919 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 SyncListPermissionContext Context for this SyncListPermissionInstance + */ + protected function proxy(): SyncListPermissionContext + { + if (!$this->context) { + $this->context = new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php new file mode 100644 index 0000000..20c928c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPermissionPage + { + + $params = Values::of([ + '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 SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function getPage(string $targetUrl): SyncListPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. + */ + public function getContext( + string $identity + + ): SyncListPermissionContext + { + return new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php new file mode 100644 index 0000000..828e878 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionInstance + */ + public function buildInstance(array $payload): SyncListPermissionInstance + { + return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php new file mode 100644 index 0000000..3598117 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php @@ -0,0 +1,214 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Updated SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + if (!$this->_syncListPermissions) { + $this->_syncListPermissions = new SyncListPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + if (!$this->_syncListItems) { + $this->_syncListItems = new SyncListItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListItems; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php new file mode 100644 index 0000000..a62f372 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php @@ -0,0 +1,185 @@ +properties = [ + '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 = ['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 SyncListContext Context for this SyncListInstance + */ + protected function proxy(): SyncListContext + { + if (!$this->context) { + $this->context = new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Updated SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + return $this->proxy()->syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + return $this->proxy()->syncListItems; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php new file mode 100644 index 0000000..a02a518 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists'; + } + + /** + * Create the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Created SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncListPage Page of SyncListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPage + { + + $params = Values::of([ + '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 SyncListPage Page of SyncListInstance + */ + public function getPage(string $targetUrl): SyncListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListContext + * + * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): SyncListContext + { + return new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php new file mode 100644 index 0000000..4a1211b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php @@ -0,0 +1,188 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Alias for collection_ttl. If both are provided, this value is ignored. + * + * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncListOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncListOptions extends Options + { + /** + * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + */ + public function __construct( + + int $ttl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `collection_ttl`. If both are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncListOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php new file mode 100644 index 0000000..a3b0e55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListInstance \Twilio\Rest\Sync\V1\Service\SyncListInstance + */ + public function buildInstance(array $payload): SyncListInstance + { + return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php new file mode 100644 index 0000000..85d3075 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php @@ -0,0 +1,150 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'key' => + $key, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items/' . \rawurlencode($key) + .''; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Update the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php new file mode 100644 index 0000000..a525779 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php @@ -0,0 +1,167 @@ +properties = [ + '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 = ['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 SyncMapItemContext Context for this SyncMapItemInstance + */ + protected function proxy(): SyncMapItemContext + { + if (!$this->context) { + $this->context = new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapItemInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php new file mode 100644 index 0000000..0ee5ec2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php @@ -0,0 +1,227 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items'; + } + + /** + * Create the SyncMapItemInstance + * + * @param string $key The unique, user-defined key for the Map Item. Can be up to 320 characters long. + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Created SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, array $data, array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Key' => + $key, + 'Data' => + Serialize::jsonObject($data), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapItemInstance 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 SyncMapItemPage Page of SyncMapItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapItemPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SyncMapItemPage Page of SyncMapItemInstance + */ + public function getPage(string $targetUrl): SyncMapItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapItemContext + * + * @param string $key The `key` value of the Sync Map Item resource to delete. + */ + public function getContext( + string $key + + ): SyncMapItemContext + { + return new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapItemList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php new file mode 100644 index 0000000..473305e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php @@ -0,0 +1,378 @@ +options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncMapItemOptions ' . $options . ']'; + } +} + +class DeleteSyncMapItemOptions extends Options + { + /** + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.DeleteSyncMapItemOptions ' . $options . ']'; + } +} + + +class ReadSyncMapItemOptions extends Options + { + /** + * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. + * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * + * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * The `key` of the first Sync Map Item resource to read. See also `bounds`. + * + * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + * + * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.ReadSyncMapItemOptions ' . $options . ']'; + } +} + +class UpdateSyncMapItemOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + int $itemTtl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncMapItemOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php new file mode 100644 index 0000000..7df0d29 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapItemInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemInstance + */ + public function buildInstance(array $payload): SyncMapItemInstance + { + return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapItemPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php new file mode 100644 index 0000000..6734c61 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php @@ -0,0 +1,144 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php new file mode 100644 index 0000000..17a3990 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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 = ['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 SyncMapPermissionContext Context for this SyncMapPermissionInstance + */ + protected function proxy(): SyncMapPermissionContext + { + if (!$this->context) { + $this->context = new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php new file mode 100644 index 0000000..77005c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPermissionPage + { + + $params = Values::of([ + '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 SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function getPage(string $targetUrl): SyncMapPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. + */ + public function getContext( + string $identity + + ): SyncMapPermissionContext + { + return new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPermissionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php new file mode 100644 index 0000000..36d2641 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionInstance + */ + public function buildInstance(array $payload): SyncMapPermissionInstance + { + return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPermissionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php new file mode 100644 index 0000000..598779b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php @@ -0,0 +1,214 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Updated SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + if (!$this->_syncMapItems) { + $this->_syncMapItems = new SyncMapItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php new file mode 100644 index 0000000..be58125 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php @@ -0,0 +1,185 @@ +properties = [ + '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 = ['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 SyncMapContext Context for this SyncMapInstance + */ + protected function proxy(): SyncMapContext + { + if (!$this->context) { + $this->context = new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Updated SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + return $this->proxy()->syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php new file mode 100644 index 0000000..b4930ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps'; + } + + /** + * Create the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Created SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncMapPage Page of SyncMapInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPage + { + + $params = Values::of([ + '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 SyncMapPage Page of SyncMapInstance + */ + public function getPage(string $targetUrl): SyncMapPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapContext + * + * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): SyncMapContext + { + return new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php new file mode 100644 index 0000000..7655584 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php @@ -0,0 +1,188 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncMapOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncMapOptions extends Options + { + /** + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + */ + public function __construct( + + int $ttl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncMapOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php new file mode 100644 index 0000000..4c58f69 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapInstance \Twilio\Rest\Sync\V1\Service\SyncMapInstance + */ + public function buildInstance(array $payload): SyncMapInstance + { + return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php new file mode 100644 index 0000000..56a8b33 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php @@ -0,0 +1,85 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessageInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php new file mode 100644 index 0000000..b78228e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php @@ -0,0 +1,94 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'streamSid' => + $streamSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams/' . \rawurlencode($streamSid) + .'/Messages'; + } + + /** + * Create the StreamMessageInstance + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length. + * @return StreamMessageInstance Created StreamMessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data): StreamMessageInstance + { + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new StreamMessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['streamSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessageList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php new file mode 100644 index 0000000..e1e9d02 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StreamMessageInstance \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageInstance + */ + public function buildInstance(array $payload): StreamMessageInstance + { + return new StreamMessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessagePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php new file mode 100644 index 0000000..47d71bc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php @@ -0,0 +1,192 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncStreamInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncStreamInstance + * + * @return SyncStreamInstance Fetched SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncStreamInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Updated SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncStreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the streamMessages + */ + protected function getStreamMessages(): StreamMessageList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncStreamContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php new file mode 100644 index 0000000..04ef763 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php @@ -0,0 +1,174 @@ +properties = [ + '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 = ['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 SyncStreamContext Context for this SyncStreamInstance + */ + protected function proxy(): SyncStreamContext + { + if (!$this->context) { + $this->context = new SyncStreamContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncStreamInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncStreamInstance + * + * @return SyncStreamInstance Fetched SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncStreamInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Updated SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncStreamInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the streamMessages + */ + protected function getStreamMessages(): StreamMessageList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncStreamInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php new file mode 100644 index 0000000..987ff58 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php @@ -0,0 +1,200 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams'; + } + + /** + * Create the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Created SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncStreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 SyncStreamPage Page of SyncStreamInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncStreamPage + { + + $params = Values::of([ + '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 SyncStreamPage Page of SyncStreamInstance + */ + public function getPage(string $targetUrl): SyncStreamPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncStreamPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncStreamContext + * + * @param string $sid The SID of the Stream resource to delete. + */ + public function getContext( + string $sid + + ): SyncStreamContext + { + return new SyncStreamContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncStreamList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php new file mode 100644 index 0000000..f18a7f1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php @@ -0,0 +1,153 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncStreamOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncStreamOptions extends Options + { + /** + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + */ + public function __construct( + + int $ttl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncStreamOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php new file mode 100644 index 0000000..3ac3e84 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncStreamInstance \Twilio\Rest\Sync\V1\Service\SyncStreamInstance + */ + public function buildInstance(array $payload): SyncStreamInstance + { + return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncStreamPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php new file mode 100644 index 0000000..24ef948 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php @@ -0,0 +1,254 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'WebhookUrl' => + $options['webhookUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + 'ReachabilityDebouncingEnabled' => + Serialize::booleanToString($options['reachabilityDebouncingEnabled']), + 'ReachabilityDebouncingWindow' => + $options['reachabilityDebouncingWindow'], + 'WebhooksFromRestEnabled' => + Serialize::booleanToString($options['webhooksFromRestEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + if (!$this->_syncLists) { + $this->_syncLists = new SyncListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncLists; + } + + /** + * Access the syncStreams + */ + protected function getSyncStreams(): SyncStreamList + { + if (!$this->_syncStreams) { + $this->_syncStreams = new SyncStreamList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncStreams; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + if (!$this->_documents) { + $this->_documents = new DocumentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php new file mode 100644 index 0000000..89eff4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php @@ -0,0 +1,209 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhooksFromRestEnabled' => Values::array_get($payload, 'webhooks_from_rest_enabled'), + 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), + 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), + 'reachabilityDebouncingEnabled' => Values::array_get($payload, 'reachability_debouncing_enabled'), + 'reachabilityDebouncingWindow' => Values::array_get($payload, 'reachability_debouncing_window'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + return $this->proxy()->syncLists; + } + + /** + * Access the syncStreams + */ + protected function getSyncStreams(): SyncStreamList + { + return $this->proxy()->syncStreams; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + return $this->proxy()->documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceList.php new file mode 100644 index 0000000..0c00c16 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'WebhookUrl' => + $options['webhookUrl'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + 'ReachabilityDebouncingEnabled' => + Serialize::booleanToString($options['reachabilityDebouncingEnabled']), + 'ReachabilityDebouncingWindow' => + $options['reachabilityDebouncingWindow'], + 'WebhooksFromRestEnabled' => + Serialize::booleanToString($options['webhooksFromRestEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php new file mode 100644 index 0000000..9123846 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php @@ -0,0 +1,350 @@ +options['friendlyName'] = $friendlyName; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + } + + /** + * A string that you assign to describe the resource. + * + * @param string $friendlyName A string that you assign to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when Sync objects are manipulated. + * + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self + { + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + return $this; + } + + /** + * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. + * + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self + { + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + return $this; + } + + /** + * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * @return $this Fluent Builder + */ + public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self + { + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @param string $friendlyName A string that you assign to describe the resource. + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + */ + public function __construct( + + string $webhookUrl = Values::NONE, + string $friendlyName = Values::NONE, + bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, + bool $aclEnabled = Values::BOOL_NONE, + bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, + int $reachabilityDebouncingWindow = Values::INT_NONE, + bool $webhooksFromRestEnabled = Values::BOOL_NONE + + ) { + $this->options['webhookUrl'] = $webhookUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + } + + /** + * The URL we should call when Sync objects are manipulated. + * + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * A string that you assign to describe the resource. + * + * @param string $friendlyName A string that you assign to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self + { + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + return $this; + } + + /** + * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self + { + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + return $this; + } + + /** + * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * @return $this Fluent Builder + */ + public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self + { + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServicePage.php new file mode 100644 index 0000000..ddcf0fd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Sync\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/SyncBase.php b/vendor/twilio/sdk/src/Twilio/Rest/SyncBase.php new file mode 100644 index 0000000..62d9246 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/SyncBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://sync.twilio.com'; + } + + + /** + * @return V1 Version v1 of sync + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Sync]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter.php new file mode 100644 index 0000000..18ba3c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter.php @@ -0,0 +1,24 @@ +workspaces instead. + */ + protected function getWorkspaces(): \Twilio\Rest\Taskrouter\V1\WorkspaceList { + echo "workspaces is deprecated. Use v1->workspaces instead."; + return $this->v1->workspaces; + } + + /** + * @deprecated Use v1->workspaces(\$sid) instead. + * @param string $sid The SID of the resource to fetch + */ + protected function contextWorkspaces(string $sid): \Twilio\Rest\Taskrouter\V1\WorkspaceContext { + echo "workspaces(\$sid) is deprecated. Use v1->workspaces(\$sid) instead."; + return $this->v1->workspaces($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1.php new file mode 100644 index 0000000..add29e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getWorkspaces(): WorkspaceList + { + if (!$this->_workspaces) { + $this->_workspaces = new WorkspaceList($this); + } + return $this->_workspaces; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Taskrouter.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php new file mode 100644 index 0000000..b9382b6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php @@ -0,0 +1,133 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Activities/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ActivityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ActivityInstance + * + * @return ActivityInstance Fetched ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ActivityInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ActivityInstance + * + * @param array|Options $options Optional Arguments + * @return ActivityInstance Updated ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ActivityInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ActivityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php new file mode 100644 index 0000000..7c5efc9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php @@ -0,0 +1,160 @@ +properties = [ + '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'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 ActivityContext Context for this ActivityInstance + */ + protected function proxy(): ActivityContext + { + if (!$this->context) { + $this->context = new ActivityContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ActivityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ActivityInstance + * + * @return ActivityInstance Fetched ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ActivityInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ActivityInstance + * + * @param array|Options $options Optional Arguments + * @return ActivityInstance Updated ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ActivityInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ActivityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php new file mode 100644 index 0000000..021b0b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php @@ -0,0 +1,210 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Activities'; + } + + /** + * Create the ActivityInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * @param array|Options $options Optional Arguments + * @return ActivityInstance Created ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ActivityInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Available' => + Serialize::booleanToString($options['available']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ActivityInstance 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 ActivityPage Page of ActivityInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ActivityPage + { + $options = new Values($options); + + $params = Values::of([ + '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 ActivityPage Page of ActivityInstance + */ + public function getPage(string $targetUrl): ActivityPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ActivityPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ActivityContext + * + * @param string $sid The SID of the Activity resource to delete. + */ + public function getContext( + string $sid + + ): ActivityContext + { + return new ActivityContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ActivityList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php new file mode 100644 index 0000000..8cd2afe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php @@ -0,0 +1,202 @@ +options['available'] = $available; + } + + /** + * Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. + * + * @param bool $available Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. + * @return $this Fluent Builder + */ + public function setAvailable(bool $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateActivityOptions ' . $options . ']'; + } +} + + + +class ReadActivityOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Activity resources to read. + * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $available = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['available'] = $available; + } + + /** + * The `friendly_name` of the Activity resources to read. + * + * @param string $friendlyName The `friendly_name` of the Activity resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + * + * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + * @return $this Fluent Builder + */ + public function setAvailable(string $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadActivityOptions ' . $options . ']'; + } +} + +class UpdateActivityOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateActivityOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php new file mode 100644 index 0000000..3bda8fe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ActivityInstance \Twilio\Rest\Taskrouter\V1\Workspace\ActivityInstance + */ + public function buildInstance(array $payload): ActivityInstance + { + return new ActivityInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ActivityPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php new file mode 100644 index 0000000..783c13d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php @@ -0,0 +1,89 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Events/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EventInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.EventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php new file mode 100644 index 0000000..ee7b531 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'actorSid' => Values::array_get($payload, 'actor_sid'), + 'actorType' => Values::array_get($payload, 'actor_type'), + 'actorUrl' => Values::array_get($payload, 'actor_url'), + 'description' => Values::array_get($payload, 'description'), + 'eventData' => Values::array_get($payload, 'event_data'), + 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), + 'eventDateMs' => Values::array_get($payload, 'event_date_ms'), + 'eventType' => Values::array_get($payload, 'event_type'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'resourceUrl' => Values::array_get($payload, 'resource_url'), + 'sid' => Values::array_get($payload, 'sid'), + 'source' => Values::array_get($payload, 'source'), + 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), + 'url' => Values::array_get($payload, 'url'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + ]; + + $this->solution = ['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 EventContext Context for this EventInstance + */ + protected function proxy(): EventContext + { + if (!$this->context) { + $this->context = new EventContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.EventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php new file mode 100644 index 0000000..7b1770e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php @@ -0,0 +1,196 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Events'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance 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 EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'EventType' => + $options['eventType'], + 'Minutes' => + $options['minutes'], + 'ReservationSid' => + $options['reservationSid'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskQueueSid' => + $options['taskQueueSid'], + 'TaskSid' => + $options['taskSid'], + 'WorkerSid' => + $options['workerSid'], + 'WorkflowSid' => + $options['workflowSid'], + 'TaskChannel' => + $options['taskChannel'], + 'Sid' => + $options['sid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventContext + * + * @param string $sid The SID of the Event resource to fetch. + */ + public function getContext( + string $sid + + ): EventContext + { + return new EventContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.EventList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php new file mode 100644 index 0000000..8e94e3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php @@ -0,0 +1,258 @@ +options['endDate'] = $endDate; + $this->options['eventType'] = $eventType; + $this->options['minutes'] = $minutes; + $this->options['reservationSid'] = $reservationSid; + $this->options['startDate'] = $startDate; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['taskSid'] = $taskSid; + $this->options['workerSid'] = $workerSid; + $this->options['workflowSid'] = $workflowSid; + $this->options['taskChannel'] = $taskChannel; + $this->options['sid'] = $sid; + } + + /** + * Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The type of Events to read. Returns only Events of the type specified. + * + * @param string $eventType The type of Events to read. Returns only Events of the type specified. + * @return $this Fluent Builder + */ + public function setEventType(string $eventType): self + { + $this->options['eventType'] = $eventType; + return $this; + } + + /** + * The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. + * + * @param int $minutes The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. + * + * @param string $reservationSid The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. + * @return $this Fluent Builder + */ + public function setReservationSid(string $reservationSid): self + { + $this->options['reservationSid'] = $reservationSid; + return $this; + } + + /** + * Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. + * + * @param \DateTime $startDate Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. + * + * @param string $taskQueueSid The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. + * + * @param string $taskSid The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. + * @return $this Fluent Builder + */ + public function setTaskSid(string $taskSid): self + { + $this->options['taskSid'] = $taskSid; + return $this; + } + + /** + * The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. + * + * @param string $workerSid The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. + * + * @param string $workflowSid The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. + * + * @param string $taskChannel The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * The SID of the Event resource to read. + * + * @param string $sid The SID of the Event resource to read. + * @return $this Fluent Builder + */ + public function setSid(string $sid): self + { + $this->options['sid'] = $sid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php new file mode 100644 index 0000000..898a6b6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Taskrouter\V1\Workspace\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.EventPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php new file mode 100644 index 0000000..b6c5bfb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php @@ -0,0 +1,233 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Reservations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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' => + $options['statusCallbackEvent'], + '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' => + $options['conferenceStatusCallbackEvent'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'Region' => + $options['region'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'DequeueStatusCallbackEvent' => + Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), + 'PostWorkActivitySid' => + $options['postWorkActivitySid'], + 'SupervisorMode' => + $options['supervisorMode'], + 'Supervisor' => + $options['supervisor'], + 'EndConferenceOnCustomerExit' => + Serialize::booleanToString($options['endConferenceOnCustomerExit']), + 'BeepOnCustomerEntrance' => + Serialize::booleanToString($options['beepOnCustomerEntrance']), + 'JitterBufferSize' => + $options['jitterBufferSize'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php new file mode 100644 index 0000000..696ff18 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 ReservationContext Context for this ReservationInstance + */ + protected function proxy(): ReservationContext + { + if (!$this->context) { + $this->context = new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php new file mode 100644 index 0000000..742f7a0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php @@ -0,0 +1,184 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Reservations'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ReservationInstance 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 ReservationPage Page of ReservationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ReservationPage + { + $options = new Values($options); + + $params = Values::of([ + 'ReservationStatus' => + $options['reservationStatus'], + 'WorkerSid' => + $options['workerSid'], + '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 ReservationPage Page of ReservationInstance + */ + public function getPage(string $targetUrl): ReservationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ReservationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ReservationContext + * + * @param string $sid The SID of the TaskReservation resource to fetch. + */ + public function getContext( + string $sid + + ): ReservationContext + { + return new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php new file mode 100644 index 0000000..1d7c4d8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php @@ -0,0 +1,1116 @@ +options['reservationStatus'] = $reservationStatus; + $this->options['workerSid'] = $workerSid; + } + + /** + * Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. + * + * @param string $reservationStatus Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The SID of the reserved Worker resource to read. + * + * @param string $workerSid The SID of the reserved Worker resource to read. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; + } +} + +class UpdateReservationOptions extends Options + { + /** + * @param string $reservationStatus + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @param string $instruction The assignment instruction for reservation. + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. + * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. + * @param int $callTimeout Timeout for call when executing a Call instruction. + * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @param int $timeout Timeout for call when executing a Conference instruction. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * @param bool $muted Whether the agent is muted in the conference. The default is `false`. + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @param string $supervisorMode + * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @param string $jitterBufferSize The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $reservationStatus = Values::NONE, + string $workerActivitySid = Values::NONE, + string $instruction = Values::NONE, + string $dequeuePostWorkActivitySid = Values::NONE, + string $dequeueFrom = Values::NONE, + string $dequeueRecord = Values::NONE, + int $dequeueTimeout = Values::INT_NONE, + string $dequeueTo = Values::NONE, + string $dequeueStatusCallbackUrl = Values::NONE, + string $callFrom = Values::NONE, + string $callRecord = Values::NONE, + int $callTimeout = Values::INT_NONE, + string $callTo = Values::NONE, + string $callUrl = Values::NONE, + string $callStatusCallbackUrl = Values::NONE, + bool $callAccept = Values::BOOL_NONE, + string $redirectCallSid = Values::NONE, + bool $redirectAccept = Values::BOOL_NONE, + string $redirectUrl = Values::NONE, + string $to = Values::NONE, + string $from = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + string $region = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, + string $postWorkActivitySid = Values::NONE, + string $supervisorMode = Values::NONE, + string $supervisor = Values::NONE, + bool $endConferenceOnCustomerExit = Values::BOOL_NONE, + bool $beepOnCustomerEntrance = Values::BOOL_NONE, + string $jitterBufferSize = Values::NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['reservationStatus'] = $reservationStatus; + $this->options['workerActivitySid'] = $workerActivitySid; + $this->options['instruction'] = $instruction; + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + $this->options['dequeueFrom'] = $dequeueFrom; + $this->options['dequeueRecord'] = $dequeueRecord; + $this->options['dequeueTimeout'] = $dequeueTimeout; + $this->options['dequeueTo'] = $dequeueTo; + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + $this->options['callFrom'] = $callFrom; + $this->options['callRecord'] = $callRecord; + $this->options['callTimeout'] = $callTimeout; + $this->options['callTo'] = $callTo; + $this->options['callUrl'] = $callUrl; + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + $this->options['callAccept'] = $callAccept; + $this->options['redirectCallSid'] = $redirectCallSid; + $this->options['redirectAccept'] = $redirectAccept; + $this->options['redirectUrl'] = $redirectUrl; + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['region'] = $region; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + $this->options['supervisorMode'] = $supervisorMode; + $this->options['supervisor'] = $supervisor; + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + $this->options['jitterBufferSize'] = $jitterBufferSize; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * @param string $reservationStatus + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The new worker activity SID if rejecting a reservation. + * + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @return $this Fluent Builder + */ + public function setWorkerActivitySid(string $workerActivitySid): self + { + $this->options['workerActivitySid'] = $workerActivitySid; + return $this; + } + + /** + * The assignment instruction for reservation. + * + * @param string $instruction The assignment instruction for reservation. + * @return $this Fluent Builder + */ + public function setInstruction(string $instruction): self + { + $this->options['instruction'] = $instruction; + return $this; + } + + /** + * The SID of the Activity resource to start after executing a Dequeue instruction. + * + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self + { + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + return $this; + } + + /** + * The Caller ID of the call to the worker when executing a Dequeue instruction. + * + * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueFrom(string $dequeueFrom): self + { + $this->options['dequeueFrom'] = $dequeueFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setDequeueRecord(string $dequeueRecord): self + { + $this->options['dequeueRecord'] = $dequeueRecord; + return $this; + } + + /** + * Timeout for call when executing a Dequeue instruction. + * + * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueTimeout(int $dequeueTimeout): self + { + $this->options['dequeueTimeout'] = $dequeueTimeout; + return $this; + } + + /** + * The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setDequeueTo(string $dequeueTo): self + { + $this->options['dequeueTo'] = $dequeueTo; + return $this; + } + + /** + * The Callback URL for completed call event when executing a Dequeue instruction. + * + * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self + { + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + return $this; + } + + /** + * The Caller ID of the outbound call when executing a Call instruction. + * + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallFrom(string $callFrom): self + { + $this->options['callFrom'] = $callFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Call instruction or which leg to record. + * + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setCallRecord(string $callRecord): self + { + $this->options['callRecord'] = $callRecord; + return $this; + } + + /** + * Timeout for call when executing a Call instruction. + * + * @param int $callTimeout Timeout for call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallTimeout(int $callTimeout): self + { + $this->options['callTimeout'] = $callTimeout; + return $this; + } + + /** + * The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setCallTo(string $callTo): self + { + $this->options['callTo'] = $callTo; + return $this; + } + + /** + * TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @return $this Fluent Builder + */ + public function setCallUrl(string $callUrl): self + { + $this->options['callUrl'] = $callUrl; + return $this; + } + + /** + * The URL to call for the completed call event when executing a Call instruction. + * + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self + { + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + return $this; + } + + /** + * Whether to accept a reservation when executing a Call instruction. + * + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallAccept(bool $callAccept): self + { + $this->options['callAccept'] = $callAccept; + return $this; + } + + /** + * The Call SID of the call parked in the queue when executing a Redirect instruction. + * + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectCallSid(string $redirectCallSid): self + { + $this->options['redirectCallSid'] = $redirectCallSid; + return $this; + } + + /** + * Whether the reservation should be accepted when executing a Redirect instruction. + * + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectAccept(bool $redirectAccept): self + { + $this->options['redirectAccept'] = $redirectAccept; + return $this; + } + + /** + * TwiML URI to redirect the call to when executing the Redirect instruction. + * + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectUrl(string $redirectUrl): self + { + $this->options['redirectUrl'] = $redirectUrl; + return $this; + } + + /** + * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * The Caller ID of the call to the worker when executing a Conference instruction. + * + * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * Timeout for call when executing a Conference instruction. + * + * @param int $timeout Timeout for call when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. The default is `false`. + * + * @param bool $muted Whether the agent is muted in the conference. The default is `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the agent leaves. + * + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The Call progress events sent via webhooks as a result of a Dequeue instruction. + * + * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self + { + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + return $this; + } + + /** + * The new worker activity SID after executing a Conference instruction. + * + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setPostWorkActivitySid(string $postWorkActivitySid): self + { + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + return $this; + } + + /** + * @param string $supervisorMode + * @return $this Fluent Builder + */ + public function setSupervisorMode(string $supervisorMode): self + { + $this->options['supervisorMode'] = $supervisorMode; + return $this; + } + + /** + * The Supervisor SID/URI when executing the Supervise instruction. + * + * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. + * @return $this Fluent Builder + */ + public function setSupervisor(string $supervisor): self + { + $this->options['supervisor'] = $supervisor; + return $this; + } + + /** + * Whether to end the conference when the customer leaves. + * + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self + { + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + return $this; + } + + /** + * Whether to play a notification beep when the customer joins. + * + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @return $this Fluent Builder + */ + public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self + { + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + return $this; + } + + /** + * The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * + * @param string $jitterBufferSize The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * @return $this Fluent Builder + */ + public function setJitterBufferSize(string $jitterBufferSize): self + { + $this->options['jitterBufferSize'] = $jitterBufferSize; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateReservationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php new file mode 100644 index 0000000..d50bfef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReservationInstance \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationInstance + */ + public function buildInstance(array $payload): ReservationInstance + { + return new ReservationInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php new file mode 100644 index 0000000..5232e3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php @@ -0,0 +1,136 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskChannels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TaskChannelInstance + * + * @return TaskChannelInstance Fetched TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskChannelInstance + * + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Updated TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ChannelOptimizedRouting' => + Serialize::booleanToString($options['channelOptimizedRouting']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php new file mode 100644 index 0000000..f9bccfb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'channelOptimizedRouting' => Values::array_get($payload, 'channel_optimized_routing'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 TaskChannelContext Context for this TaskChannelInstance + */ + protected function proxy(): TaskChannelContext + { + if (!$this->context) { + $this->context = new TaskChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskChannelInstance + * + * @return TaskChannelInstance Fetched TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskChannelInstance + * + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Updated TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php new file mode 100644 index 0000000..f325423 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php @@ -0,0 +1,205 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskChannels'; + } + + /** + * Create the TaskChannelInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the Task Channel, such as `voice` or `sms`. + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Created TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $uniqueName, array $options = []): TaskChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'UniqueName' => + $uniqueName, + 'ChannelOptimizedRouting' => + Serialize::booleanToString($options['channelOptimizedRouting']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 TaskChannelPage Page of TaskChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskChannelPage + { + + $params = Values::of([ + '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 TaskChannelPage Page of TaskChannelInstance + */ + public function getPage(string $targetUrl): TaskChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskChannelContext + * + * @param string $sid The SID of the Task Channel resource to delete. + */ + public function getContext( + string $sid + + ): TaskChannelContext + { + return new TaskChannelContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php new file mode 100644 index 0000000..fce3235 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php @@ -0,0 +1,152 @@ +options['channelOptimizedRouting'] = $channelOptimizedRouting; + } + + /** + * Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * + * @param bool $channelOptimizedRouting Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * @return $this Fluent Builder + */ + public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self + { + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskChannelOptions ' . $options . ']'; + } +} + + + + +class UpdateTaskChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $channelOptimizedRouting = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + } + + /** + * A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * + * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * @return $this Fluent Builder + */ + public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self + { + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php new file mode 100644 index 0000000..6e4e3db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskChannelInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelInstance + */ + public function buildInstance(array $payload): TaskChannelInstance + { + return new TaskChannelInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php new file mode 100644 index 0000000..003d1b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php @@ -0,0 +1,206 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Attributes' => + $options['attributes'], + 'AssignmentStatus' => + $options['assignmentStatus'], + 'Reason' => + $options['reason'], + 'Priority' => + $options['priority'], + 'TaskChannel' => + $options['taskChannel'], + 'VirtualStartTime' => + Serialize::iso8601DateTime($options['virtualStartTime']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + 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 ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php new file mode 100644 index 0000000..01b6ebd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php @@ -0,0 +1,202 @@ +properties = [ + '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')), + 'taskQueueEnteredDate' => Deserialize::dateTime(Values::array_get($payload, 'task_queue_entered_date')), + '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'), + 'virtualStartTime' => Deserialize::dateTime(Values::array_get($payload, 'virtual_start_time')), + 'ignoreCapacity' => Values::array_get($payload, 'ignore_capacity'), + 'routingTarget' => Values::array_get($payload, 'routing_target'), + ]; + + $this->solution = ['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 TaskContext Context for this TaskInstance + */ + protected function proxy(): TaskContext + { + if (!$this->context) { + $this->context = new TaskContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php new file mode 100644 index 0000000..7443286 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php @@ -0,0 +1,239 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks'; + } + + /** + * Create the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Created TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Timeout' => + $options['timeout'], + 'Priority' => + $options['priority'], + 'TaskChannel' => + $options['taskChannel'], + 'WorkflowSid' => + $options['workflowSid'], + 'Attributes' => + $options['attributes'], + 'VirtualStartTime' => + Serialize::iso8601DateTime($options['virtualStartTime']), + 'RoutingTarget' => + $options['routingTarget'], + 'IgnoreCapacity' => + $options['ignoreCapacity'], + 'TaskQueueSid' => + $options['taskQueueSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskPage Page of TaskInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskPage + { + $options = new Values($options); + + $params = Values::of([ + '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'], + 'RoutingTarget' => + $options['routingTarget'], + '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 TaskPage Page of TaskInstance + */ + public function getPage(string $targetUrl): TaskPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskContext + * + * @param string $sid The SID of the Task resource to delete. + */ + public function getContext( + string $sid + + ): TaskContext + { + return new TaskContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php new file mode 100644 index 0000000..bcb261e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php @@ -0,0 +1,646 @@ +options['timeout'] = $timeout; + $this->options['priority'] = $priority; + $this->options['taskChannel'] = $taskChannel; + $this->options['workflowSid'] = $workflowSid; + $this->options['attributes'] = $attributes; + $this->options['virtualStartTime'] = $virtualStartTime; + $this->options['routingTarget'] = $routingTarget; + $this->options['ignoreCapacity'] = $ignoreCapacity; + $this->options['taskQueueSid'] = $taskQueueSid; + } + + /** + * The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. + * + * @param int $timeout The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). + * + * @param int $priority The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. + * + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. + * + * @param string $workflowSid The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + * + * @param string $attributes A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + * + * @param \DateTime $virtualStartTime The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + * @return $this Fluent Builder + */ + public function setVirtualStartTime(\DateTime $virtualStartTime): self + { + $this->options['virtualStartTime'] = $virtualStartTime; + return $this; + } + + /** + * A SID of a Worker, Queue, or Workflow to route a Task to + * + * @param string $routingTarget A SID of a Worker, Queue, or Workflow to route a Task to + * @return $this Fluent Builder + */ + public function setRoutingTarget(string $routingTarget): self + { + $this->options['routingTarget'] = $routingTarget; + return $this; + } + + /** + * A boolean indicating if a new task should respect a worker's capacity during assignment + * + * @param string $ignoreCapacity A boolean indicating if a new task should respect a worker's capacity during assignment + * @return $this Fluent Builder + */ + public function setIgnoreCapacity(string $ignoreCapacity): self + { + $this->options['ignoreCapacity'] = $ignoreCapacity; + return $this; + } + + /** + * The SID of the TaskQueue in which the Task belongs + * + * @param string $taskQueueSid The SID of the TaskQueue in which the Task belongs + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskOptions ' . $options . ']'; + } +} + +class DeleteTaskOptions extends Options + { + /** + * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.DeleteTaskOptions ' . $options . ']'; + } +} + + +class ReadTaskOptions extends Options + { + /** + * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * @param string $routingTarget A SID of a Worker, Queue, or Workflow to route a Task to + * @param string $ordering How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. + * @param bool $hasAddons Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. + */ + public function __construct( + + int $priority = Values::INT_NONE, + array $assignmentStatus = Values::ARRAY_NONE, + string $workflowSid = Values::NONE, + string $workflowName = Values::NONE, + string $taskQueueSid = Values::NONE, + string $taskQueueName = Values::NONE, + string $evaluateTaskAttributes = Values::NONE, + string $routingTarget = Values::NONE, + string $ordering = Values::NONE, + bool $hasAddons = Values::BOOL_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['routingTarget'] = $routingTarget; + $this->options['ordering'] = $ordering; + $this->options['hasAddons'] = $hasAddons; + } + + /** + * The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * + * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * + * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * @return $this Fluent Builder + */ + public function setAssignmentStatus(array $assignmentStatus): self + { + $this->options['assignmentStatus'] = $assignmentStatus; + return $this; + } + + /** + * The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * + * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * + * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * @return $this Fluent Builder + */ + public function setWorkflowName(string $workflowName): self + { + $this->options['workflowName'] = $workflowName; + return $this; + } + + /** + * The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * + * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * + * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * @return $this Fluent Builder + */ + public function setEvaluateTaskAttributes(string $evaluateTaskAttributes): self + { + $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; + return $this; + } + + /** + * A SID of a Worker, Queue, or Workflow to route a Task to + * + * @param string $routingTarget A SID of a Worker, Queue, or Workflow to route a Task to + * @return $this Fluent Builder + */ + public function setRoutingTarget(string $routingTarget): self + { + $this->options['routingTarget'] = $routingTarget; + return $this; + } + + /** + * How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. + * + * @param string $ordering How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. + * + * @param bool $hasAddons Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. + * @return $this Fluent Builder + */ + public function setHasAddons(bool $hasAddons): self + { + $this->options['hasAddons'] = $hasAddons; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskOptions ' . $options . ']'; + } +} + +class UpdateTaskOptions extends Options + { + /** + * @param string $attributes The JSON string that describes the custom attributes of the task. + * @param string $assignmentStatus + * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @param \DateTime $virtualStartTime The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $attributes = Values::NONE, + string $assignmentStatus = Values::NONE, + string $reason = Values::NONE, + int $priority = Values::INT_NONE, + string $taskChannel = Values::NONE, + \DateTime $virtualStartTime = null, + string $ifMatch = Values::NONE + + ) { + $this->options['attributes'] = $attributes; + $this->options['assignmentStatus'] = $assignmentStatus; + $this->options['reason'] = $reason; + $this->options['priority'] = $priority; + $this->options['taskChannel'] = $taskChannel; + $this->options['virtualStartTime'] = $virtualStartTime; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The JSON string that describes the custom attributes of the task. + * + * @param string $attributes The JSON string that describes the custom attributes of the task. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $assignmentStatus + * @return $this Fluent Builder + */ + public function setAssignmentStatus(string $assignmentStatus): self + { + $this->options['assignmentStatus'] = $assignmentStatus; + return $this; + } + + /** + * The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * + * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * @return $this Fluent Builder + */ + public function setReason(string $reason): self + { + $this->options['reason'] = $reason; + return $this; + } + + /** + * The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * + * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + * + * @param \DateTime $virtualStartTime The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + * @return $this Fluent Builder + */ + public function setVirtualStartTime(\DateTime $virtualStartTime): self + { + $this->options['virtualStartTime'] = $virtualStartTime; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php new file mode 100644 index 0000000..75198c1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskInstance + */ + public function buildInstance(array $payload): TaskInstance + { + return new TaskInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php new file mode 100644 index 0000000..2e48360 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'taskQueueData' => Values::array_get($payload, 'task_queue_data'), + 'taskQueueResponseCount' => Values::array_get($payload, 'task_queue_response_count'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php new file mode 100644 index 0000000..995b83f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php @@ -0,0 +1,81 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/RealTimeStatistics'; + } + + /** + * Create the TaskQueueBulkRealTimeStatisticsInstance + * + * @return TaskQueueBulkRealTimeStatisticsInstance Created TaskQueueBulkRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): TaskQueueBulkRealTimeStatisticsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TaskQueueBulkRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php new file mode 100644 index 0000000..3a9f052 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueBulkRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueBulkRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueBulkRealTimeStatisticsInstance + { + return new TaskQueueBulkRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php new file mode 100644 index 0000000..0292c5c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php @@ -0,0 +1,107 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the TaskQueueCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueCumulativeStatisticsInstance Fetched TaskQueueCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new TaskQueueCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php new file mode 100644 index 0000000..54421bf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php @@ -0,0 +1,162 @@ +properties = [ + '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'), + 'waitDurationInQueueUntilAccepted' => Values::array_get($payload, 'wait_duration_in_queue_until_accepted'), + '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 = ['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 TaskQueueCumulativeStatisticsContext Context for this TaskQueueCumulativeStatisticsInstance + */ + protected function proxy(): TaskQueueCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueCumulativeStatisticsInstance Fetched TaskQueueCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueCumulativeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php new file mode 100644 index 0000000..258468b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueCumulativeStatisticsContext + */ + public function getContext( + + ): TaskQueueCumulativeStatisticsContext + { + return new TaskQueueCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php new file mode 100644 index 0000000..eb3d6fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php new file mode 100644 index 0000000..917640d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueCumulativeStatisticsInstance + { + return new TaskQueueCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php new file mode 100644 index 0000000..b5f15e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php @@ -0,0 +1,98 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the TaskQueueRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueRealTimeStatisticsInstance Fetched TaskQueueRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new TaskQueueRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php new file mode 100644 index 0000000..7d97217 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'longestRelativeTaskAgeInQueue' => Values::array_get($payload, 'longest_relative_task_age_in_queue'), + 'longestRelativeTaskSidInQueue' => Values::array_get($payload, 'longest_relative_task_sid_in_queue'), + '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 = ['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 TaskQueueRealTimeStatisticsContext Context for this TaskQueueRealTimeStatisticsInstance + */ + protected function proxy(): TaskQueueRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueRealTimeStatisticsInstance Fetched TaskQueueRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueRealTimeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php new file mode 100644 index 0000000..ccbaf99 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueRealTimeStatisticsContext + */ + public function getContext( + + ): TaskQueueRealTimeStatisticsContext + { + return new TaskQueueRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php new file mode 100644 index 0000000..a85990c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php new file mode 100644 index 0000000..404eeca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueRealTimeStatisticsInstance + { + return new TaskQueueRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php new file mode 100644 index 0000000..fe96bc3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php @@ -0,0 +1,107 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/Statistics'; + } + + /** + * Fetch the TaskQueueStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new TaskQueueStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php new file mode 100644 index 0000000..d4c9d36 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php @@ -0,0 +1,129 @@ +properties = [ + '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 = ['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 TaskQueueStatisticsContext Context for this TaskQueueStatisticsInstance + */ + protected function proxy(): TaskQueueStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php new file mode 100644 index 0000000..2c72b3a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueStatisticsContext + */ + public function getContext( + + ): TaskQueueStatisticsContext + { + return new TaskQueueStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php new file mode 100644 index 0000000..1648a2b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php new file mode 100644 index 0000000..dfcf2f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueStatisticsInstance + { + return new TaskQueueStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php new file mode 100644 index 0000000..eb938fa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php @@ -0,0 +1,89 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php new file mode 100644 index 0000000..1d266cf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php @@ -0,0 +1,169 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/Statistics'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskQueuesStatisticsInstance 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 TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskQueuesStatisticsPage + { + $options = new Values($options); + + $params = Values::of([ + '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 TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance + */ + public function getPage(string $targetUrl): TaskQueuesStatisticsPage + { + $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(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php new file mode 100644 index 0000000..279316c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php @@ -0,0 +1,166 @@ +options['endDate'] = $endDate; + $this->options['friendlyName'] = $friendlyName; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue statistics to read. + * + * @param string $friendlyName The `friendly_name` of the TaskQueue statistics to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskQueuesStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php new file mode 100644 index 0000000..4446586 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueuesStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueuesStatisticsInstance + { + return new TaskQueuesStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php new file mode 100644 index 0000000..3f7b5d5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php @@ -0,0 +1,242 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskQueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TaskQueueInstance + * + * @return TaskQueueInstance Fetched TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskQueueInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskQueueInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Updated TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskQueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'TargetWorkers' => + $options['targetWorkers'], + 'ReservationActivitySid' => + $options['reservationActivitySid'], + 'AssignmentActivitySid' => + $options['assignmentActivitySid'], + 'MaxReservedWorkers' => + $options['maxReservedWorkers'], + 'TaskOrder' => + $options['taskOrder'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new TaskQueueCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueueStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskQueueStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new TaskQueueRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php new file mode 100644 index 0000000..05bd277 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php @@ -0,0 +1,203 @@ +properties = [ + '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 = ['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 TaskQueueContext Context for this TaskQueueInstance + */ + protected function proxy(): TaskQueueContext + { + if (!$this->context) { + $this->context = new TaskQueueContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskQueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskQueueInstance + * + * @return TaskQueueInstance Fetched TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskQueueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskQueueInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Updated TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskQueueInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueueStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php new file mode 100644 index 0000000..9e29c0e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php @@ -0,0 +1,294 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues'; + } + + /** + * Create the TaskQueueInstance + * + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Created TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): TaskQueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'TargetWorkers' => + $options['targetWorkers'], + 'MaxReservedWorkers' => + $options['maxReservedWorkers'], + 'TaskOrder' => + $options['taskOrder'], + 'ReservationActivitySid' => + $options['reservationActivitySid'], + 'AssignmentActivitySid' => + $options['assignmentActivitySid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskQueueInstance 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 TaskQueuePage Page of TaskQueueInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskQueuePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'EvaluateWorkerAttributes' => + $options['evaluateWorkerAttributes'], + 'WorkerSid' => + $options['workerSid'], + 'Ordering' => + $options['ordering'], + '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 TaskQueuePage Page of TaskQueueInstance + */ + public function getPage(string $targetUrl): TaskQueuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskQueuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskQueueContext + * + * @param string $sid The SID of the TaskQueue resource to delete. + */ + public function getContext( + string $sid + + ): TaskQueueContext + { + return new TaskQueueContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Access the bulkRealTimeStatistics + */ + protected function getBulkRealTimeStatistics(): TaskQueueBulkRealTimeStatisticsList + { + if (!$this->_bulkRealTimeStatistics) { + $this->_bulkRealTimeStatistics = new TaskQueueBulkRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'] + ); + } + return $this->_bulkRealTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueuesStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskQueuesStatisticsList( + $this->version, + $this->solution['workspaceSid'] + ); + } + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php new file mode 100644 index 0000000..1442ab3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php @@ -0,0 +1,396 @@ +options['targetWorkers'] = $targetWorkers; + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + $this->options['taskOrder'] = $taskOrder; + $this->options['reservationActivitySid'] = $reservationActivitySid; + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + } + + /** + * A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). + * + * @param string $targetWorkers A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). + * @return $this Fluent Builder + */ + public function setTargetWorkers(string $targetWorkers): self + { + $this->options['targetWorkers'] = $targetWorkers; + return $this; + } + + /** + * The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. + * + * @param int $maxReservedWorkers The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. + * @return $this Fluent Builder + */ + public function setMaxReservedWorkers(int $maxReservedWorkers): self + { + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + return $this; + } + + /** + * @param string $taskOrder + * @return $this Fluent Builder + */ + public function setTaskOrder(string $taskOrder): self + { + $this->options['taskOrder'] = $taskOrder; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is reserved for them. + * + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @return $this Fluent Builder + */ + public function setReservationActivitySid(string $reservationActivitySid): self + { + $this->options['reservationActivitySid'] = $reservationActivitySid; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is assigned to them. + * + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned to them. + * @return $this Fluent Builder + */ + public function setAssignmentActivitySid(string $assignmentActivitySid): self + { + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskQueueOptions ' . $options . ']'; + } +} + + + +class ReadTaskQueueOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. + * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. + * @param string $ordering Sorting parameter for TaskQueues + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $evaluateWorkerAttributes = Values::NONE, + string $workerSid = Values::NONE, + string $ordering = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; + $this->options['workerSid'] = $workerSid; + $this->options['ordering'] = $ordering; + } + + /** + * The `friendly_name` of the TaskQueue resources to read. + * + * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * + * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * @return $this Fluent Builder + */ + public function setEvaluateWorkerAttributes(string $evaluateWorkerAttributes): self + { + $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; + return $this; + } + + /** + * The SID of the Worker with the TaskQueue resources to read. + * + * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * Sorting parameter for TaskQueues + * + * @param string $ordering Sorting parameter for TaskQueues + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskQueueOptions ' . $options . ']'; + } +} + +class UpdateTaskQueueOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. + * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * @param string $taskOrder + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $targetWorkers = Values::NONE, + string $reservationActivitySid = Values::NONE, + string $assignmentActivitySid = Values::NONE, + int $maxReservedWorkers = Values::INT_NONE, + string $taskOrder = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['targetWorkers'] = $targetWorkers; + $this->options['reservationActivitySid'] = $reservationActivitySid; + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + $this->options['taskOrder'] = $taskOrder; + } + + /** + * A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * + * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * @return $this Fluent Builder + */ + public function setTargetWorkers(string $targetWorkers): self + { + $this->options['targetWorkers'] = $targetWorkers; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is reserved for them. + * + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @return $this Fluent Builder + */ + public function setReservationActivitySid(string $reservationActivitySid): self + { + $this->options['reservationActivitySid'] = $reservationActivitySid; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is assigned for them. + * + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. + * @return $this Fluent Builder + */ + public function setAssignmentActivitySid(string $assignmentActivitySid): self + { + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + return $this; + } + + /** + * The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * + * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * @return $this Fluent Builder + */ + public function setMaxReservedWorkers(int $maxReservedWorkers): self + { + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + return $this; + } + + /** + * @param string $taskOrder + * @return $this Fluent Builder + */ + public function setTaskOrder(string $taskOrder): self + { + $this->options['taskOrder'] = $taskOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskQueueOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php new file mode 100644 index 0000000..fae8604 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueInstance + */ + public function buildInstance(array $payload): TaskQueueInstance + { + return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php new file mode 100644 index 0000000..aa65631 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php @@ -0,0 +1,229 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Reservations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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' => + $options['statusCallbackEvent'], + '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' => + $options['conferenceStatusCallbackEvent'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'Region' => + $options['region'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'DequeueStatusCallbackEvent' => + Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), + 'PostWorkActivitySid' => + $options['postWorkActivitySid'], + 'EndConferenceOnCustomerExit' => + Serialize::booleanToString($options['endConferenceOnCustomerExit']), + 'BeepOnCustomerEntrance' => + Serialize::booleanToString($options['beepOnCustomerEntrance']), + 'JitterBufferSize' => + $options['jitterBufferSize'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php new file mode 100644 index 0000000..a2dd5a3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php @@ -0,0 +1,154 @@ +properties = [ + '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 = ['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 ReservationContext Context for this ReservationInstance + */ + protected function proxy(): ReservationContext + { + if (!$this->context) { + $this->context = new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php new file mode 100644 index 0000000..7b33fee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php @@ -0,0 +1,182 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Reservations'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ReservationInstance 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 ReservationPage Page of ReservationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ReservationPage + { + $options = new Values($options); + + $params = Values::of([ + '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 ReservationPage Page of ReservationInstance + */ + public function getPage(string $targetUrl): ReservationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ReservationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ReservationContext + * + * @param string $sid The SID of the WorkerReservation resource to fetch. + */ + public function getContext( + string $sid + + ): ReservationContext + { + return new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php new file mode 100644 index 0000000..1eae508 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php @@ -0,0 +1,1064 @@ +options['reservationStatus'] = $reservationStatus; + } + + /** + * Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. + * + * @param string $reservationStatus Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; + } +} + +class UpdateReservationOptions extends Options + { + /** + * @param string $reservationStatus + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @param string $instruction The assignment instruction for the reservation. + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. + * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. + * @param int $callTimeout The timeout for a call when executing a Call instruction. + * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $from The caller ID of the call to the worker when executing a Conference instruction. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @param int $timeout The timeout for a call when executing a Conference instruction. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @param string $jitterBufferSize The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $reservationStatus = Values::NONE, + string $workerActivitySid = Values::NONE, + string $instruction = Values::NONE, + string $dequeuePostWorkActivitySid = Values::NONE, + string $dequeueFrom = Values::NONE, + string $dequeueRecord = Values::NONE, + int $dequeueTimeout = Values::INT_NONE, + string $dequeueTo = Values::NONE, + string $dequeueStatusCallbackUrl = Values::NONE, + string $callFrom = Values::NONE, + string $callRecord = Values::NONE, + int $callTimeout = Values::INT_NONE, + string $callTo = Values::NONE, + string $callUrl = Values::NONE, + string $callStatusCallbackUrl = Values::NONE, + bool $callAccept = Values::BOOL_NONE, + string $redirectCallSid = Values::NONE, + bool $redirectAccept = Values::BOOL_NONE, + string $redirectUrl = Values::NONE, + string $to = Values::NONE, + string $from = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + string $region = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, + string $postWorkActivitySid = Values::NONE, + bool $endConferenceOnCustomerExit = Values::BOOL_NONE, + bool $beepOnCustomerEntrance = Values::BOOL_NONE, + string $jitterBufferSize = Values::NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['reservationStatus'] = $reservationStatus; + $this->options['workerActivitySid'] = $workerActivitySid; + $this->options['instruction'] = $instruction; + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + $this->options['dequeueFrom'] = $dequeueFrom; + $this->options['dequeueRecord'] = $dequeueRecord; + $this->options['dequeueTimeout'] = $dequeueTimeout; + $this->options['dequeueTo'] = $dequeueTo; + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + $this->options['callFrom'] = $callFrom; + $this->options['callRecord'] = $callRecord; + $this->options['callTimeout'] = $callTimeout; + $this->options['callTo'] = $callTo; + $this->options['callUrl'] = $callUrl; + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + $this->options['callAccept'] = $callAccept; + $this->options['redirectCallSid'] = $redirectCallSid; + $this->options['redirectAccept'] = $redirectAccept; + $this->options['redirectUrl'] = $redirectUrl; + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['region'] = $region; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + $this->options['jitterBufferSize'] = $jitterBufferSize; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * @param string $reservationStatus + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The new worker activity SID if rejecting a reservation. + * + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @return $this Fluent Builder + */ + public function setWorkerActivitySid(string $workerActivitySid): self + { + $this->options['workerActivitySid'] = $workerActivitySid; + return $this; + } + + /** + * The assignment instruction for the reservation. + * + * @param string $instruction The assignment instruction for the reservation. + * @return $this Fluent Builder + */ + public function setInstruction(string $instruction): self + { + $this->options['instruction'] = $instruction; + return $this; + } + + /** + * The SID of the Activity resource to start after executing a Dequeue instruction. + * + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self + { + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + return $this; + } + + /** + * The caller ID of the call to the worker when executing a Dequeue instruction. + * + * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueFrom(string $dequeueFrom): self + { + $this->options['dequeueFrom'] = $dequeueFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setDequeueRecord(string $dequeueRecord): self + { + $this->options['dequeueRecord'] = $dequeueRecord; + return $this; + } + + /** + * The timeout for call when executing a Dequeue instruction. + * + * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueTimeout(int $dequeueTimeout): self + { + $this->options['dequeueTimeout'] = $dequeueTimeout; + return $this; + } + + /** + * The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setDequeueTo(string $dequeueTo): self + { + $this->options['dequeueTo'] = $dequeueTo; + return $this; + } + + /** + * The callback URL for completed call event when executing a Dequeue instruction. + * + * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self + { + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + return $this; + } + + /** + * The Caller ID of the outbound call when executing a Call instruction. + * + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallFrom(string $callFrom): self + { + $this->options['callFrom'] = $callFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Call instruction. + * + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallRecord(string $callRecord): self + { + $this->options['callRecord'] = $callRecord; + return $this; + } + + /** + * The timeout for a call when executing a Call instruction. + * + * @param int $callTimeout The timeout for a call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallTimeout(int $callTimeout): self + { + $this->options['callTimeout'] = $callTimeout; + return $this; + } + + /** + * The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setCallTo(string $callTo): self + { + $this->options['callTo'] = $callTo; + return $this; + } + + /** + * TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @return $this Fluent Builder + */ + public function setCallUrl(string $callUrl): self + { + $this->options['callUrl'] = $callUrl; + return $this; + } + + /** + * The URL to call for the completed call event when executing a Call instruction. + * + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self + { + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + return $this; + } + + /** + * Whether to accept a reservation when executing a Call instruction. + * + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallAccept(bool $callAccept): self + { + $this->options['callAccept'] = $callAccept; + return $this; + } + + /** + * The Call SID of the call parked in the queue when executing a Redirect instruction. + * + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectCallSid(string $redirectCallSid): self + { + $this->options['redirectCallSid'] = $redirectCallSid; + return $this; + } + + /** + * Whether the reservation should be accepted when executing a Redirect instruction. + * + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectAccept(bool $redirectAccept): self + { + $this->options['redirectAccept'] = $redirectAccept; + return $this; + } + + /** + * TwiML URI to redirect the call to when executing the Redirect instruction. + * + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectUrl(string $redirectUrl): self + { + $this->options['redirectUrl'] = $redirectUrl; + return $this; + } + + /** + * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * The caller ID of the call to the worker when executing a Conference instruction. + * + * @param string $from The caller ID of the call to the worker when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * The timeout for a call when executing a Conference instruction. + * + * @param int $timeout The timeout for a call when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. Defaults to `false`. + * + * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the agent leaves. + * + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The call progress events sent via webhooks as a result of a Dequeue instruction. + * + * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self + { + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + return $this; + } + + /** + * The new worker activity SID after executing a Conference instruction. + * + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setPostWorkActivitySid(string $postWorkActivitySid): self + { + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + return $this; + } + + /** + * Whether to end the conference when the customer leaves. + * + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self + { + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + return $this; + } + + /** + * Whether to play a notification beep when the customer joins. + * + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @return $this Fluent Builder + */ + public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self + { + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + return $this; + } + + /** + * The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * + * @param string $jitterBufferSize The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. + * @return $this Fluent Builder + */ + public function setJitterBufferSize(string $jitterBufferSize): self + { + $this->options['jitterBufferSize'] = $jitterBufferSize; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateReservationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php new file mode 100644 index 0000000..c26b09a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReservationInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationInstance + */ + public function buildInstance(array $payload): ReservationInstance + { + return new ReservationInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php new file mode 100644 index 0000000..52d2818 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php @@ -0,0 +1,129 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the WorkerChannelInstance + * + * @return WorkerChannelInstance Fetched WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerChannelInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WorkerChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkerChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerChannelInstance Updated WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Capacity' => + $options['capacity'], + 'Available' => + Serialize::booleanToString($options['available']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php new file mode 100644 index 0000000..7b98ef4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php @@ -0,0 +1,158 @@ +properties = [ + '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 = ['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 WorkerChannelContext Context for this WorkerChannelInstance + */ + protected function proxy(): WorkerChannelContext + { + if (!$this->context) { + $this->context = new WorkerChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkerChannelInstance + * + * @return WorkerChannelInstance Fetched WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkerChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerChannelInstance Updated WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerChannelInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php new file mode 100644 index 0000000..1b63ebe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Channels'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 WorkerChannelPage Page of WorkerChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkerChannelPage + { + + $params = Values::of([ + '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 WorkerChannelPage Page of WorkerChannelInstance + */ + public function getPage(string $targetUrl): WorkerChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkerChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkerChannelContext + * + * @param string $sid The SID of the WorkerChannel to fetch. + */ + public function getContext( + string $sid + + ): WorkerChannelContext + { + return new WorkerChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerChannelList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php new file mode 100644 index 0000000..3da4f30 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php @@ -0,0 +1,98 @@ +options['capacity'] = $capacity; + $this->options['available'] = $available; + } + + /** + * The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. + * + * @param int $capacity The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. + * @return $this Fluent Builder + */ + public function setCapacity(int $capacity): self + { + $this->options['capacity'] = $capacity; + return $this; + } + + /** + * Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. + * + * @param bool $available Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. + * @return $this Fluent Builder + */ + public function setAvailable(bool $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkerChannelOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php new file mode 100644 index 0000000..7ac390f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerChannelInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelInstance + */ + public function buildInstance(array $payload): WorkerChannelInstance + { + return new WorkerChannelInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerChannelPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php new file mode 100644 index 0000000..5e22ec3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php @@ -0,0 +1,105 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Statistics'; + } + + /** + * Fetch the WorkerStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkerStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkerStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php new file mode 100644 index 0000000..12bb811 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php @@ -0,0 +1,127 @@ +properties = [ + '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 = ['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 WorkerStatisticsContext Context for this WorkerStatisticsInstance + */ + protected function proxy(): WorkerStatisticsContext + { + if (!$this->context) { + $this->context = new WorkerStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkerStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkerStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php new file mode 100644 index 0000000..42be214 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + } + + /** + * Constructs a WorkerStatisticsContext + */ + public function getContext( + + ): WorkerStatisticsContext + { + return new WorkerStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php new file mode 100644 index 0000000..68454e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php @@ -0,0 +1,130 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkerStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php new file mode 100644 index 0000000..722c1d9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsInstance + */ + public function buildInstance(array $payload): WorkerStatisticsInstance + { + return new WorkerStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php new file mode 100644 index 0000000..5385601 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php @@ -0,0 +1,99 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/CumulativeStatistics'; + } + + /** + * Fetch the WorkersCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersCumulativeStatisticsInstance Fetched WorkersCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkersCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php new file mode 100644 index 0000000..c3cec60 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php @@ -0,0 +1,140 @@ +properties = [ + '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 = ['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 WorkersCumulativeStatisticsContext Context for this WorkersCumulativeStatisticsInstance + */ + protected function proxy(): WorkersCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersCumulativeStatisticsInstance Fetched WorkersCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersCumulativeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php new file mode 100644 index 0000000..a1ef103 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersCumulativeStatisticsContext + */ + public function getContext( + + ): WorkersCumulativeStatisticsContext + { + return new WorkersCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php new file mode 100644 index 0000000..8291f21 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php @@ -0,0 +1,130 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php new file mode 100644 index 0000000..aa71da1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkersCumulativeStatisticsInstance + { + return new WorkersCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php new file mode 100644 index 0000000..702a870 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php @@ -0,0 +1,92 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/RealTimeStatistics'; + } + + /** + * Fetch the WorkersRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersRealTimeStatisticsInstance Fetched WorkersRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkersRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php new file mode 100644 index 0000000..a047bad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + '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 = ['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 WorkersRealTimeStatisticsContext Context for this WorkersRealTimeStatisticsInstance + */ + protected function proxy(): WorkersRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersRealTimeStatisticsInstance Fetched WorkersRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersRealTimeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php new file mode 100644 index 0000000..f7ea954 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersRealTimeStatisticsContext + */ + public function getContext( + + ): WorkersRealTimeStatisticsContext + { + return new WorkersRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php new file mode 100644 index 0000000..32e3855 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php new file mode 100644 index 0000000..66a3d9e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkersRealTimeStatisticsInstance + { + return new WorkersRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php new file mode 100644 index 0000000..2bc9980 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php @@ -0,0 +1,105 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/Statistics'; + } + + /** + * Fetch the WorkersStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkersStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php new file mode 100644 index 0000000..6f84355 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + '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 = ['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 WorkersStatisticsContext Context for this WorkersStatisticsInstance + */ + protected function proxy(): WorkersStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php new file mode 100644 index 0000000..e8f488f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersStatisticsContext + */ + public function getContext( + + ): WorkersStatisticsContext + { + return new WorkersStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php new file mode 100644 index 0000000..b74024a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php @@ -0,0 +1,184 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['taskQueueName'] = $taskQueueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The SID of the TaskQueue for which to fetch Worker statistics. + * + * @param string $taskQueueSid The SID of the TaskQueue for which to fetch Worker statistics. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue for which to fetch Worker statistics. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue for which to fetch Worker statistics. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * Only include Workers with `friendly_name` values that match this parameter. + * + * @param string $friendlyName Only include Workers with `friendly_name` values that match this parameter. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php new file mode 100644 index 0000000..eb2585e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsInstance + */ + public function buildInstance(array $payload): WorkersStatisticsInstance + { + return new WorkersStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php new file mode 100644 index 0000000..9c04ec2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php @@ -0,0 +1,282 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WorkerInstance + * + * @return WorkerInstance Fetched WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerInstance Updated WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ActivitySid' => + $options['activitySid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + 'RejectPendingReservations' => + Serialize::booleanToString($options['rejectPendingReservations']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' , 'If-Match' => $options['ifMatch']]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the workerChannels + */ + protected function getWorkerChannels(): WorkerChannelList + { + if (!$this->_workerChannels) { + $this->_workerChannels = new WorkerChannelList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_workerChannels; + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + if (!$this->_reservations) { + $this->_reservations = new ReservationList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_reservations; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkersRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkerStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkerStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkersCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php new file mode 100644 index 0000000..6320177 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php @@ -0,0 +1,220 @@ +properties = [ + '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 = ['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 WorkerContext Context for this WorkerInstance + */ + protected function proxy(): WorkerContext + { + if (!$this->context) { + $this->context = new WorkerContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the WorkerInstance + * + * @return WorkerInstance Fetched WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerInstance Updated WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the workerChannels + */ + protected function getWorkerChannels(): WorkerChannelList + { + return $this->proxy()->workerChannels; + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + return $this->proxy()->reservations; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkerStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList + { + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php new file mode 100644 index 0000000..71b361e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php @@ -0,0 +1,280 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers'; + } + + /** + * Create the WorkerInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return WorkerInstance Created WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): WorkerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'ActivitySid' => + $options['activitySid'], + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkerInstance 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 WorkerPage Page of WorkerInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkerPage + { + $options = new Values($options); + + $params = Values::of([ + 'ActivityName' => + $options['activityName'], + 'ActivitySid' => + $options['activitySid'], + 'Available' => + $options['available'], + 'FriendlyName' => + $options['friendlyName'], + 'TargetWorkersExpression' => + $options['targetWorkersExpression'], + 'TaskQueueName' => + $options['taskQueueName'], + 'TaskQueueSid' => + $options['taskQueueSid'], + 'Ordering' => + $options['ordering'], + '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 WorkerPage Page of WorkerInstance + */ + public function getPage(string $targetUrl): WorkerPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkerPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkerContext + * + * @param string $sid The SID of the Worker resource to delete. + */ + public function getContext( + string $sid + + ): WorkerContext + { + return new WorkerContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkersStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkersStatisticsList( + $this->version, + $this->solution['workspaceSid'] + ); + } + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Taskrouter.V1.WorkerList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php new file mode 100644 index 0000000..0c894dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php @@ -0,0 +1,450 @@ +options['activitySid'] = $activitySid; + $this->options['attributes'] = $attributes; + } + + /** + * The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. + * + * @param string $activitySid The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * + * @param string $attributes A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkerOptions ' . $options . ']'; + } +} + +class DeleteWorkerOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.DeleteWorkerOptions ' . $options . ']'; + } +} + + +class ReadWorkerOptions extends Options + { + /** + * @param string $activityName The `activity_name` of the Worker resources to read. + * @param string $activitySid The `activity_sid` of the Worker resources to read. + * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * @param string $friendlyName The `friendly_name` of the Worker resources to read. + * @param string $targetWorkersExpression Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` + * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. + * @param string $ordering Sorting parameter for Workers + */ + public function __construct( + + string $activityName = Values::NONE, + string $activitySid = Values::NONE, + string $available = Values::NONE, + string $friendlyName = Values::NONE, + string $targetWorkersExpression = Values::NONE, + string $taskQueueName = Values::NONE, + string $taskQueueSid = Values::NONE, + string $ordering = 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; + $this->options['ordering'] = $ordering; + } + + /** + * The `activity_name` of the Worker resources to read. + * + * @param string $activityName The `activity_name` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setActivityName(string $activityName): self + { + $this->options['activityName'] = $activityName; + return $this; + } + + /** + * The `activity_sid` of the Worker resources to read. + * + * @param string $activitySid The `activity_sid` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * + * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * @return $this Fluent Builder + */ + public function setAvailable(string $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * The `friendly_name` of the Worker resources to read. + * + * @param string $friendlyName The `friendly_name` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` + * + * @param string $targetWorkersExpression Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` + * @return $this Fluent Builder + */ + public function setTargetWorkersExpression(string $targetWorkersExpression): self + { + $this->options['targetWorkersExpression'] = $targetWorkersExpression; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * The SID of the TaskQueue that the Workers to read are eligible for. + * + * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * Sorting parameter for Workers + * + * @param string $ordering Sorting parameter for Workers + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkerOptions ' . $options . ']'; + } +} + +class UpdateWorkerOptions extends Options + { + /** + * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $activitySid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + bool $rejectPendingReservations = Values::BOOL_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['activitySid'] = $activitySid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['rejectPendingReservations'] = $rejectPendingReservations; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * + * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * + * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * + * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * @return $this Fluent Builder + */ + public function setRejectPendingReservations(bool $rejectPendingReservations): self + { + $this->options['rejectPendingReservations'] = $rejectPendingReservations; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkerOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php new file mode 100644 index 0000000..c7c8359 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkerInstance + */ + public function buildInstance(array $payload): WorkerInstance + { + return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php new file mode 100644 index 0000000..f89d86d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php @@ -0,0 +1,107 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the WorkflowCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowCumulativeStatisticsInstance Fetched WorkflowCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkflowCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php new file mode 100644 index 0000000..86b86ae --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php @@ -0,0 +1,162 @@ +properties = [ + '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 = ['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 WorkflowCumulativeStatisticsContext Context for this WorkflowCumulativeStatisticsInstance + */ + protected function proxy(): WorkflowCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowCumulativeStatisticsInstance Fetched WorkflowCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowCumulativeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php new file mode 100644 index 0000000..d247d81 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowCumulativeStatisticsContext + */ + public function getContext( + + ): WorkflowCumulativeStatisticsContext + { + return new WorkflowCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php new file mode 100644 index 0000000..751808b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php new file mode 100644 index 0000000..039228b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowCumulativeStatisticsInstance + { + return new WorkflowCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php new file mode 100644 index 0000000..c9185db --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php @@ -0,0 +1,98 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the WorkflowRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowRealTimeStatisticsInstance Fetched WorkflowRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkflowRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php new file mode 100644 index 0000000..8c366bc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), + 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), + 'totalTasks' => Values::array_get($payload, 'total_tasks'), + 'workflowSid' => Values::array_get($payload, 'workflow_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 WorkflowRealTimeStatisticsContext Context for this WorkflowRealTimeStatisticsInstance + */ + protected function proxy(): WorkflowRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowRealTimeStatisticsInstance Fetched WorkflowRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowRealTimeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php new file mode 100644 index 0000000..fc264b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowRealTimeStatisticsContext + */ + public function getContext( + + ): WorkflowRealTimeStatisticsContext + { + return new WorkflowRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php new file mode 100644 index 0000000..ed177b7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php new file mode 100644 index 0000000..04bb01f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowRealTimeStatisticsInstance + { + return new WorkflowRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php new file mode 100644 index 0000000..c3ae4c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php @@ -0,0 +1,107 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/Statistics'; + } + + /** + * Fetch the WorkflowStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkflowStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php new file mode 100644 index 0000000..aee5159 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php @@ -0,0 +1,129 @@ +properties = [ + '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 = ['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 WorkflowStatisticsContext Context for this WorkflowStatisticsInstance + */ + protected function proxy(): WorkflowStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php new file mode 100644 index 0000000..0b16df9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowStatisticsContext + */ + public function getContext( + + ): WorkflowStatisticsContext + { + return new WorkflowStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php new file mode 100644 index 0000000..d009b59 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php @@ -0,0 +1,148 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php new file mode 100644 index 0000000..9bd5669 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowStatisticsInstance + { + return new WorkflowStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php new file mode 100644 index 0000000..ff6c8a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php @@ -0,0 +1,242 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkflowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WorkflowInstance + * + * @return WorkflowInstance Fetched WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkflowInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkflowInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Updated WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkflowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'AssignmentCallbackUrl' => + $options['assignmentCallbackUrl'], + 'FallbackAssignmentCallbackUrl' => + $options['fallbackAssignmentCallbackUrl'], + 'Configuration' => + $options['configuration'], + 'TaskReservationTimeout' => + $options['taskReservationTimeout'], + 'ReEvaluateTasks' => + $options['reEvaluateTasks'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the statistics + */ + protected function getStatistics(): WorkflowStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkflowStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkflowCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkflowRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php new file mode 100644 index 0000000..8831849 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php @@ -0,0 +1,199 @@ +properties = [ + '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 = ['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 WorkflowContext Context for this WorkflowInstance + */ + protected function proxy(): WorkflowContext + { + if (!$this->context) { + $this->context = new WorkflowContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkflowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WorkflowInstance + * + * @return WorkflowInstance Fetched WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkflowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkflowInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Updated WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkflowInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkflowStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php new file mode 100644 index 0000000..4564489 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php @@ -0,0 +1,214 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows'; + } + + /** + * Create the WorkflowInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Created WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $configuration, array $options = []): WorkflowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Configuration' => + $configuration, + 'AssignmentCallbackUrl' => + $options['assignmentCallbackUrl'], + 'FallbackAssignmentCallbackUrl' => + $options['fallbackAssignmentCallbackUrl'], + 'TaskReservationTimeout' => + $options['taskReservationTimeout'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkflowInstance 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 WorkflowPage Page of WorkflowInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkflowPage + { + $options = new Values($options); + + $params = Values::of([ + '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 WorkflowPage Page of WorkflowInstance + */ + public function getPage(string $targetUrl): WorkflowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkflowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkflowContext + * + * @param string $sid The SID of the Workflow resource to delete. + */ + public function getContext( + string $sid + + ): WorkflowContext + { + return new WorkflowContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php new file mode 100644 index 0000000..9efc40e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php @@ -0,0 +1,310 @@ +options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + } + + /** + * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @return $this Fluent Builder + */ + public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self + { + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + return $this; + } + + /** + * The URL that we should call when a call to the `assignment_callback_url` fails. + * + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @return $this Fluent Builder + */ + public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self + { + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + return $this; + } + + /** + * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @return $this Fluent Builder + */ + public function setTaskReservationTimeout(int $taskReservationTimeout): self + { + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkflowOptions ' . $options . ']'; + } +} + + + +class ReadWorkflowOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Workflow resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Workflow resources to read. + * + * @param string $friendlyName The `friendly_name` of the Workflow resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkflowOptions ' . $options . ']'; + } +} + +class UpdateWorkflowOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $assignmentCallbackUrl = Values::NONE, + string $fallbackAssignmentCallbackUrl = Values::NONE, + string $configuration = Values::NONE, + int $taskReservationTimeout = Values::INT_NONE, + string $reEvaluateTasks = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + $this->options['configuration'] = $configuration; + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + $this->options['reEvaluateTasks'] = $reEvaluateTasks; + } + + /** + * A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @return $this Fluent Builder + */ + public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self + { + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + return $this; + } + + /** + * The URL that we should call when a call to the `assignment_callback_url` fails. + * + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @return $this Fluent Builder + */ + public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self + { + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + return $this; + } + + /** + * A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @return $this Fluent Builder + */ + public function setConfiguration(string $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @return $this Fluent Builder + */ + public function setTaskReservationTimeout(int $taskReservationTimeout): self + { + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + return $this; + } + + /** + * Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + * + * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + * @return $this Fluent Builder + */ + public function setReEvaluateTasks(string $reEvaluateTasks): self + { + $this->options['reEvaluateTasks'] = $reEvaluateTasks; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkflowOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php new file mode 100644 index 0000000..29e3fc9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowInstance + */ + public function buildInstance(array $payload): WorkflowInstance + { + return new WorkflowInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php new file mode 100644 index 0000000..ae1351e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php @@ -0,0 +1,101 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the WorkspaceCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceCumulativeStatisticsInstance Fetched WorkspaceCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkspaceCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php new file mode 100644 index 0000000..ecfe80f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php @@ -0,0 +1,158 @@ +properties = [ + '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 = ['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 WorkspaceCumulativeStatisticsContext Context for this WorkspaceCumulativeStatisticsInstance + */ + protected function proxy(): WorkspaceCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceCumulativeStatisticsInstance Fetched WorkspaceCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceCumulativeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php new file mode 100644 index 0000000..cf6d57f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceCumulativeStatisticsContext + */ + public function getContext( + + ): WorkspaceCumulativeStatisticsContext + { + return new WorkspaceCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php new file mode 100644 index 0000000..cc903b0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php new file mode 100644 index 0000000..4cadb43 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceCumulativeStatisticsInstance + { + return new WorkspaceCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php new file mode 100644 index 0000000..e7b6c11 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php @@ -0,0 +1,92 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the WorkspaceRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceRealTimeStatisticsInstance Fetched WorkspaceRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkspaceRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php new file mode 100644 index 0000000..a1c7726 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), + 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), + 'totalTasks' => Values::array_get($payload, 'total_tasks'), + 'totalWorkers' => Values::array_get($payload, 'total_workers'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 WorkspaceRealTimeStatisticsContext Context for this WorkspaceRealTimeStatisticsInstance + */ + protected function proxy(): WorkspaceRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceRealTimeStatisticsInstance Fetched WorkspaceRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceRealTimeStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php new file mode 100644 index 0000000..5fb1dd6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceRealTimeStatisticsContext + */ + public function getContext( + + ): WorkspaceRealTimeStatisticsContext + { + return new WorkspaceRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php new file mode 100644 index 0000000..a36a0e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php new file mode 100644 index 0000000..d79ec5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceRealTimeStatisticsInstance + { + return new WorkspaceRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php new file mode 100644 index 0000000..50bdde0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php @@ -0,0 +1,101 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Statistics'; + } + + /** + * Fetch the WorkspaceStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new WorkspaceStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php new file mode 100644 index 0000000..48a013f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + '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 = ['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 WorkspaceStatisticsContext Context for this WorkspaceStatisticsInstance + */ + protected function proxy(): WorkspaceStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceStatisticsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php new file mode 100644 index 0000000..48da1e1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceStatisticsContext + */ + public function getContext( + + ): WorkspaceStatisticsContext + { + return new WorkspaceStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php new file mode 100644 index 0000000..1766309 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php @@ -0,0 +1,148 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceStatisticsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php new file mode 100644 index 0000000..f4bd897 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceStatisticsInstance + { + return new WorkspaceStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php new file mode 100644 index 0000000..afc993e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php @@ -0,0 +1,368 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkspaceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WorkspaceInstance + * + * @return WorkspaceInstance Fetched WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkspaceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WorkspaceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the WorkspaceInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Updated WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkspaceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultActivitySid' => + $options['defaultActivitySid'], + 'EventCallbackUrl' => + $options['eventCallbackUrl'], + 'EventsFilter' => + $options['eventsFilter'], + 'FriendlyName' => + $options['friendlyName'], + 'MultiTaskEnabled' => + Serialize::booleanToString($options['multiTaskEnabled']), + 'TimeoutActivitySid' => + $options['timeoutActivitySid'], + 'PrioritizeQueueOrder' => + $options['prioritizeQueueOrder'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WorkspaceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the taskQueues + */ + protected function getTaskQueues(): TaskQueueList + { + if (!$this->_taskQueues) { + $this->_taskQueues = new TaskQueueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_taskQueues; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the taskChannels + */ + protected function getTaskChannels(): TaskChannelList + { + if (!$this->_taskChannels) { + $this->_taskChannels = new TaskChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_taskChannels; + } + + /** + * Access the activities + */ + protected function getActivities(): ActivityList + { + if (!$this->_activities) { + $this->_activities = new ActivityList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_activities; + } + + /** + * Access the workers + */ + protected function getWorkers(): WorkerList + { + if (!$this->_workers) { + $this->_workers = new WorkerList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_workers; + } + + /** + * Access the workflows + */ + protected function getWorkflows(): WorkflowList + { + if (!$this->_workflows) { + $this->_workflows = new WorkflowList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_workflows; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + if (!$this->_tasks) { + $this->_tasks = new TaskList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tasks; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkspaceCumulativeStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkspaceStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkspaceStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php new file mode 100644 index 0000000..0e83e87 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php @@ -0,0 +1,271 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkspaceContext Context for this WorkspaceInstance + */ + protected function proxy(): WorkspaceContext + { + if (!$this->context) { + $this->context = new WorkspaceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkspaceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WorkspaceInstance + * + * @return WorkspaceInstance Fetched WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkspaceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkspaceInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Updated WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkspaceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the taskQueues + */ + protected function getTaskQueues(): TaskQueueList + { + return $this->proxy()->taskQueues; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the taskChannels + */ + protected function getTaskChannels(): TaskChannelList + { + return $this->proxy()->taskChannels; + } + + /** + * Access the activities + */ + protected function getActivities(): ActivityList + { + return $this->proxy()->activities; + } + + /** + * Access the workers + */ + protected function getWorkers(): WorkerList + { + return $this->proxy()->workers; + } + + /** + * Access the workflows + */ + protected function getWorkflows(): WorkflowList + { + return $this->proxy()->workflows; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + return $this->proxy()->tasks; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkspaceStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceList.php new file mode 100644 index 0000000..64af1f4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/Workspaces'; + } + + /** + * Create the WorkspaceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example: `Customer Support` or `2014 Election Campaign`. + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Created WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): WorkspaceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'EventCallbackUrl' => + $options['eventCallbackUrl'], + 'EventsFilter' => + $options['eventsFilter'], + 'MultiTaskEnabled' => + Serialize::booleanToString($options['multiTaskEnabled']), + 'Template' => + $options['template'], + 'PrioritizeQueueOrder' => + $options['prioritizeQueueOrder'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WorkspaceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkspaceInstance 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 WorkspacePage Page of WorkspaceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkspacePage + { + $options = new Values($options); + + $params = Values::of([ + '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 WorkspacePage Page of WorkspaceInstance + */ + public function getPage(string $targetUrl): WorkspacePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkspacePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkspaceContext + * + * @param string $sid The SID of the Workspace resource to delete. + */ + public function getContext( + string $sid + + ): WorkspaceContext + { + return new WorkspaceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php new file mode 100644 index 0000000..f498bee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php @@ -0,0 +1,360 @@ +options['eventCallbackUrl'] = $eventCallbackUrl; + $this->options['eventsFilter'] = $eventsFilter; + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + $this->options['template'] = $template; + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + } + + /** + * The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * + * @param string $eventCallbackUrl The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @return $this Fluent Builder + */ + public function setEventCallbackUrl(string $eventCallbackUrl): self + { + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + return $this; + } + + /** + * The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @return $this Fluent Builder + */ + public function setEventsFilter(string $eventsFilter): self + { + $this->options['eventsFilter'] = $eventsFilter; + return $this; + } + + /** + * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @return $this Fluent Builder + */ + public function setMultiTaskEnabled(bool $multiTaskEnabled): self + { + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + return $this; + } + + /** + * An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. + * + * @param string $template An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. + * @return $this Fluent Builder + */ + public function setTemplate(string $template): self + { + $this->options['template'] = $template; + return $this; + } + + /** + * @param string $prioritizeQueueOrder + * @return $this Fluent Builder + */ + public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self + { + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkspaceOptions ' . $options . ']'; + } +} + + + +class ReadWorkspaceOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + * + * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkspaceOptions ' . $options . ']'; + } +} + +class UpdateWorkspaceOptions extends Options + { + /** + * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. + * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * @param string $prioritizeQueueOrder + */ + public function __construct( + + string $defaultActivitySid = Values::NONE, + string $eventCallbackUrl = Values::NONE, + string $eventsFilter = Values::NONE, + string $friendlyName = Values::NONE, + bool $multiTaskEnabled = Values::BOOL_NONE, + string $timeoutActivitySid = Values::NONE, + string $prioritizeQueueOrder = Values::NONE + + ) { + $this->options['defaultActivitySid'] = $defaultActivitySid; + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + $this->options['eventsFilter'] = $eventsFilter; + $this->options['friendlyName'] = $friendlyName; + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + $this->options['timeoutActivitySid'] = $timeoutActivitySid; + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + } + + /** + * The SID of the Activity that will be used when new Workers are created in the Workspace. + * + * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. + * @return $this Fluent Builder + */ + public function setDefaultActivitySid(string $defaultActivitySid): self + { + $this->options['defaultActivitySid'] = $defaultActivitySid; + return $this; + } + + /** + * The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * + * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @return $this Fluent Builder + */ + public function setEventCallbackUrl(string $eventCallbackUrl): self + { + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + return $this; + } + + /** + * The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @return $this Fluent Builder + */ + public function setEventsFilter(string $eventsFilter): self + { + $this->options['eventsFilter'] = $eventsFilter; + return $this; + } + + /** + * A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @return $this Fluent Builder + */ + public function setMultiTaskEnabled(bool $multiTaskEnabled): self + { + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + return $this; + } + + /** + * The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * + * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * @return $this Fluent Builder + */ + public function setTimeoutActivitySid(string $timeoutActivitySid): self + { + $this->options['timeoutActivitySid'] = $timeoutActivitySid; + return $this; + } + + /** + * @param string $prioritizeQueueOrder + * @return $this Fluent Builder + */ + public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self + { + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkspaceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspacePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspacePage.php new file mode 100644 index 0000000..ed544a7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/WorkspacePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceInstance \Twilio\Rest\Taskrouter\V1\WorkspaceInstance + */ + public function buildInstance(array $payload): WorkspaceInstance + { + return new WorkspaceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspacePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/TaskrouterBase.php b/vendor/twilio/sdk/src/Twilio/Rest/TaskrouterBase.php new file mode 100644 index 0000000..e9dbe3d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/TaskrouterBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://taskrouter.twilio.com'; + } + + + /** + * @return V1 Version v1 of taskrouter + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Taskrouter]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking.php new file mode 100644 index 0000000..52231c5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking.php @@ -0,0 +1,24 @@ +trunks instead. + */ + protected function getTrunks(): \Twilio\Rest\Trunking\V1\TrunkList { + echo "trunks is deprecated. Use v1->trunks instead."; + return $this->v1->trunks; + } + + /** + * @deprecated Use v1->trunks(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextTrunks(string $sid): \Twilio\Rest\Trunking\V1\TrunkContext { + echo "trunks(\$sid) is deprecated. Use v1->trunks(\$sid) instead."; + return $this->v1->trunks($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1.php new file mode 100644 index 0000000..5ae6aa3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getTrunks(): TrunkList + { + if (!$this->_trunks) { + $this->_trunks = new TrunkList($this); + } + return $this->_trunks; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Trunking.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php new file mode 100644 index 0000000..5bc8d90 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php @@ -0,0 +1,103 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/CredentialLists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.CredentialListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php new file mode 100644 index 0000000..779adb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php @@ -0,0 +1,142 @@ +properties = [ + '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 = ['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 CredentialListContext Context for this CredentialListInstance + */ + protected function proxy(): CredentialListContext + { + if (!$this->context) { + $this->context = new CredentialListContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.CredentialListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php new file mode 100644 index 0000000..1076c6b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php @@ -0,0 +1,195 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/CredentialLists'; + } + + /** + * Create the CredentialListInstance + * + * @param string $credentialListSid The SID of the [Credential List](https://www.twilio.com/docs/voice/sip/api/sip-credentiallist-resource) that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list. + * @return CredentialListInstance Created CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): CredentialListInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CredentialListPage Page of CredentialListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListPage + { + + $params = Values::of([ + '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 CredentialListPage Page of CredentialListInstance + */ + public function getPage(string $targetUrl): CredentialListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListContext + * + * @param string $sid The unique string that we created to identify the CredentialList resource to delete. + */ + public function getContext( + string $sid + + ): CredentialListContext + { + return new CredentialListContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.CredentialListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php new file mode 100644 index 0000000..a5e0c79 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListInstance \Twilio\Rest\Trunking\V1\Trunk\CredentialListInstance + */ + public function buildInstance(array $payload): CredentialListInstance + { + return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.CredentialListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php new file mode 100644 index 0000000..6122b00 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php @@ -0,0 +1,103 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/IpAccessControlLists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.IpAccessControlListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php new file mode 100644 index 0000000..78f210f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php @@ -0,0 +1,142 @@ +properties = [ + '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 = ['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 IpAccessControlListContext Context for this IpAccessControlListInstance + */ + protected function proxy(): IpAccessControlListContext + { + if (!$this->context) { + $this->context = new IpAccessControlListContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php new file mode 100644 index 0000000..35031d4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php @@ -0,0 +1,195 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/IpAccessControlLists'; + } + + /** + * Create the IpAccessControlListInstance + * + * @param string $ipAccessControlListSid The SID of the [IP Access Control List](https://www.twilio.com/docs/voice/sip/api/sip-ipaccesscontrollist-resource) that you want to associate with the trunk. + * @return IpAccessControlListInstance Created IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): IpAccessControlListInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListPage + { + + $params = Values::of([ + '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 IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function getPage(string $targetUrl): IpAccessControlListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListContext + * + * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListContext + { + return new IpAccessControlListContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.IpAccessControlListList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php new file mode 100644 index 0000000..7057078 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListInstance \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListInstance + */ + public function buildInstance(array $payload): IpAccessControlListInstance + { + return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.IpAccessControlListPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php new file mode 100644 index 0000000..6396a9a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php @@ -0,0 +1,142 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/OriginationUrls/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the OriginationUrlInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the OriginationUrlInstance + * + * @return OriginationUrlInstance Fetched OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OriginationUrlInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the OriginationUrlInstance + * + * @param array|Options $options Optional Arguments + * @return OriginationUrlInstance Updated OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OriginationUrlInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Weight' => + $options['weight'], + 'Priority' => + $options['priority'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'FriendlyName' => + $options['friendlyName'], + 'SipUrl' => + $options['sipUrl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.OriginationUrlContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php new file mode 100644 index 0000000..25f720f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php @@ -0,0 +1,164 @@ +properties = [ + '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 = ['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 OriginationUrlContext Context for this OriginationUrlInstance + */ + protected function proxy(): OriginationUrlContext + { + if (!$this->context) { + $this->context = new OriginationUrlContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the OriginationUrlInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the OriginationUrlInstance + * + * @return OriginationUrlInstance Fetched OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OriginationUrlInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the OriginationUrlInstance + * + * @param array|Options $options Optional Arguments + * @return OriginationUrlInstance Updated OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OriginationUrlInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.OriginationUrlInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php new file mode 100644 index 0000000..25f61dc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php @@ -0,0 +1,208 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/OriginationUrls'; + } + + /** + * Create the OriginationUrlInstance + * + * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * @param bool $enabled Whether the URL is enabled. The default is `true`. + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. + * @return OriginationUrlInstance Created OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(int $weight, int $priority, bool $enabled, string $friendlyName, string $sipUrl): OriginationUrlInstance + { + + $data = Values::of([ + 'Weight' => + $weight, + 'Priority' => + $priority, + 'Enabled' => + Serialize::booleanToString($enabled), + 'FriendlyName' => + $friendlyName, + 'SipUrl' => + $sipUrl, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 OriginationUrlPage Page of OriginationUrlInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OriginationUrlPage + { + + $params = Values::of([ + '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 OriginationUrlPage Page of OriginationUrlInstance + */ + public function getPage(string $targetUrl): OriginationUrlPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OriginationUrlPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OriginationUrlContext + * + * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. + */ + public function getContext( + string $sid + + ): OriginationUrlContext + { + return new OriginationUrlContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.OriginationUrlList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php new file mode 100644 index 0000000..288dc71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php @@ -0,0 +1,156 @@ +options['weight'] = $weight; + $this->options['priority'] = $priority; + $this->options['enabled'] = $enabled; + $this->options['friendlyName'] = $friendlyName; + $this->options['sipUrl'] = $sipUrl; + } + + /** + * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * + * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * Whether the URL is enabled. The default is `true`. + * + * @param bool $enabled Whether the URL is enabled. The default is `true`. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. + * + * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @return $this Fluent Builder + */ + public function setSipUrl(string $sipUrl): self + { + $this->options['sipUrl'] = $sipUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateOriginationUrlOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php new file mode 100644 index 0000000..696ef6d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OriginationUrlInstance \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlInstance + */ + public function buildInstance(array $payload): OriginationUrlInstance + { + return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.OriginationUrlPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php new file mode 100644 index 0000000..53ea9b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php @@ -0,0 +1,103 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php new file mode 100644 index 0000000..075ef3c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php @@ -0,0 +1,180 @@ +properties = [ + '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 = ['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 PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php new file mode 100644 index 0000000..5b8b5b1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php @@ -0,0 +1,195 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param string $phoneNumberSid The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk. + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumberSid): PhoneNumberInstance + { + + $data = Values::of([ + 'PhoneNumberSid' => + $phoneNumberSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + '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 PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.PhoneNumberList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php new file mode 100644 index 0000000..4c80b7f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.PhoneNumberPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php new file mode 100644 index 0000000..513c816 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php @@ -0,0 +1,114 @@ +solution = [ + 'trunkSid' => + $trunkSid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/Recording'; + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Mode' => + $options['mode'], + 'Trim' => + $options['trim'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php new file mode 100644 index 0000000..5121e26 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'mode' => Values::array_get($payload, 'mode'), + 'trim' => Values::array_get($payload, 'trim'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['trunkSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php new file mode 100644 index 0000000..96c73c1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php @@ -0,0 +1,67 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + } + + /** + * Constructs a RecordingContext + */ + public function getContext( + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['trunkSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.RecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php new file mode 100644 index 0000000..db48a19 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php @@ -0,0 +1,92 @@ +options['mode'] = $mode; + $this->options['trim'] = $trim; + } + + /** + * @param string $mode + * @return $this Fluent Builder + */ + public function setMode(string $mode): self + { + $this->options['mode'] = $mode; + return $this; + } + + /** + * @param string $trim + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php new file mode 100644 index 0000000..eec39a4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Trunking\V1\Trunk\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.RecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php new file mode 100644 index 0000000..6f80601 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php @@ -0,0 +1,275 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DomainName' => + $options['domainName'], + 'DisasterRecoveryUrl' => + $options['disasterRecoveryUrl'], + 'DisasterRecoveryMethod' => + $options['disasterRecoveryMethod'], + 'TransferMode' => + $options['transferMode'], + 'Secure' => + Serialize::booleanToString($options['secure']), + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'TransferCallerId' => + $options['transferCallerId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + if (!$this->_ipAccessControlLists) { + $this->_ipAccessControlLists = new IpAccessControlListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_ipAccessControlLists; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the credentialsLists + */ + protected function getCredentialsLists(): CredentialListList + { + if (!$this->_credentialsLists) { + $this->_credentialsLists = new CredentialListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_credentialsLists; + } + + /** + * Access the originationUrls + */ + protected function getOriginationUrls(): OriginationUrlList + { + if (!$this->_originationUrls) { + $this->_originationUrls = new OriginationUrlList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_originationUrls; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.TrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php new file mode 100644 index 0000000..1788189 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php @@ -0,0 +1,225 @@ +properties = [ + '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'), + 'transferMode' => Values::array_get($payload, 'transfer_mode'), + 'transferCallerId' => Values::array_get($payload, 'transfer_caller_id'), + 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), + 'authType' => Values::array_get($payload, 'auth_type'), + 'authTypeSet' => Values::array_get($payload, 'auth_type_set'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrunkContext Context for this TrunkInstance + */ + protected function proxy(): TrunkContext + { + if (!$this->context) { + $this->context = new TrunkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + return $this->proxy()->ipAccessControlLists; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the credentialsLists + */ + protected function getCredentialsLists(): CredentialListList + { + return $this->proxy()->credentialsLists; + } + + /** + * Access the originationUrls + */ + protected function getOriginationUrls(): OriginationUrlList + { + return $this->proxy()->originationUrls; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.TrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php new file mode 100644 index 0000000..90c82d3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php @@ -0,0 +1,205 @@ +solution = [ + ]; + + $this->uri = '/Trunks'; + } + + /** + * Create the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Created TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DomainName' => + $options['domainName'], + 'DisasterRecoveryUrl' => + $options['disasterRecoveryUrl'], + 'DisasterRecoveryMethod' => + $options['disasterRecoveryMethod'], + 'TransferMode' => + $options['transferMode'], + 'Secure' => + Serialize::booleanToString($options['secure']), + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'TransferCallerId' => + $options['transferCallerId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TrunkInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 TrunkPage Page of TrunkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrunkPage + { + + $params = Values::of([ + '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 TrunkPage Page of TrunkInstance + */ + public function getPage(string $targetUrl): TrunkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrunkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrunkContext + * + * @param string $sid The unique string that we created to identify the Trunk resource to delete. + */ + public function getContext( + string $sid + + ): TrunkContext + { + return new TrunkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.TrunkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php new file mode 100644 index 0000000..89ed853 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php @@ -0,0 +1,378 @@ +options['friendlyName'] = $friendlyName; + $this->options['domainName'] = $domainName; + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + $this->options['transferMode'] = $transferMode; + $this->options['secure'] = $secure; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['transferCallerId'] = $transferCallerId; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self + { + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + return $this; + } + + /** + * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self + { + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + return $this; + } + + /** + * @param string $transferMode + * @return $this Fluent Builder + */ + public function setTransferMode(string $transferMode): self + { + $this->options['transferMode'] = $transferMode; + return $this; + } + + /** + * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * @param string $transferCallerId + * @return $this Fluent Builder + */ + public function setTransferCallerId(string $transferCallerId): self + { + $this->options['transferCallerId'] = $transferCallerId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.CreateTrunkOptions ' . $options . ']'; + } +} + + + + +class UpdateTrunkOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @param string $transferMode + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @param string $transferCallerId + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $domainName = Values::NONE, + string $disasterRecoveryUrl = Values::NONE, + string $disasterRecoveryMethod = Values::NONE, + string $transferMode = Values::NONE, + bool $secure = Values::BOOL_NONE, + bool $cnamLookupEnabled = Values::BOOL_NONE, + string $transferCallerId = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['domainName'] = $domainName; + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + $this->options['transferMode'] = $transferMode; + $this->options['secure'] = $secure; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['transferCallerId'] = $transferCallerId; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self + { + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + return $this; + } + + /** + * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self + { + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + return $this; + } + + /** + * @param string $transferMode + * @return $this Fluent Builder + */ + public function setTransferMode(string $transferMode): self + { + $this->options['transferMode'] = $transferMode; + return $this; + } + + /** + * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * @param string $transferCallerId + * @return $this Fluent Builder + */ + public function setTransferCallerId(string $transferCallerId): self + { + $this->options['transferCallerId'] = $transferCallerId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateTrunkOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php new file mode 100644 index 0000000..d136af3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrunkInstance \Twilio\Rest\Trunking\V1\TrunkInstance + */ + public function buildInstance(array $payload): TrunkInstance + { + return new TrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.TrunkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/TrunkingBase.php b/vendor/twilio/sdk/src/Twilio/Rest/TrunkingBase.php new file mode 100644 index 0000000..fd02bcd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/TrunkingBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://trunking.twilio.com'; + } + + + /** + * @return V1 Version v1 of trunking + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Trunking]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub.php new file mode 100644 index 0000000..8ac1f15 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub.php @@ -0,0 +1,128 @@ +customerProfiles instead. + */ + protected function getCustomerProfiles(): \Twilio\Rest\Trusthub\V1\CustomerProfilesList { + echo "customerProfiles is deprecated. Use v1->customerProfiles instead."; + return $this->v1->customerProfiles; + } + + /** + * @deprecated Use v1->customerProfiles(\$sid) instead. + * @param string $sid The unique string that identifies the resource. + */ + protected function contextCustomerProfiles(string $sid): \Twilio\Rest\Trusthub\V1\CustomerProfilesContext { + echo "customerProfiles(\$sid) is deprecated. Use v1->customerProfiles(\$sid) instead."; + return $this->v1->customerProfiles($sid); + } + + /** + * @deprecated Use v1->endUsers instead. + */ + protected function getEndUsers(): \Twilio\Rest\Trusthub\V1\EndUserList { + echo "endUsers is deprecated. Use v1->endUsers instead."; + return $this->v1->endUsers; + } + + /** + * @deprecated Use v1->endUsers(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextEndUsers(string $sid): \Twilio\Rest\Trusthub\V1\EndUserContext { + echo "endUsers(\$sid) is deprecated. Use v1->endUsers(\$sid) instead."; + return $this->v1->endUsers($sid); + } + + /** + * @deprecated Use v1->endUserTypes instead. + */ + protected function getEndUserTypes(): \Twilio\Rest\Trusthub\V1\EndUserTypeList { + echo "endUserTypes is deprecated. Use v1->endUserTypes instead."; + return $this->v1->endUserTypes; + } + + /** + * @deprecated Use v1->endUserTypes(\$sid) instead. + * @param string $sid The unique string that identifies the End-User Type + * resource + */ + protected function contextEndUserTypes(string $sid): \Twilio\Rest\Trusthub\V1\EndUserTypeContext { + echo "endUserTypes(\$sid) is deprecated. Use v1->endUserTypes(\$sid) instead."; + return $this->v1->endUserTypes($sid); + } + + /** + * @deprecated Use v1->policies instead. + */ + protected function getPolicies(): \Twilio\Rest\Trusthub\V1\PoliciesList { + echo "policies is deprecated. Use v1->policies instead."; + return $this->v1->policies; + } + + /** + * @deprecated Use v1->policies(\$sid) instead. + * @param string $sid The unique string that identifies the Policy resource + */ + protected function contextPolicies(string $sid): \Twilio\Rest\Trusthub\V1\PoliciesContext { + echo "policies(\$sid) is deprecated. Use v1->policies(\$sid) instead."; + return $this->v1->policies($sid); + } + + /** + * @deprecated Use v1->supportingDocuments instead. + */ + protected function getSupportingDocuments(): \Twilio\Rest\Trusthub\V1\SupportingDocumentList { + echo "supportingDocuments is deprecated. Use v1->supportingDocuments instead."; + return $this->v1->supportingDocuments; + } + + /** + * @deprecated Use v1->supportingDocuments(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextSupportingDocuments(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentContext { + echo "supportingDocuments(\$sid) is deprecated. Use v1->supportingDocuments(\$sid) instead."; + return $this->v1->supportingDocuments($sid); + } + + /** + * @deprecated Use v1->supportingDocumentTypes instead. + */ + protected function getSupportingDocumentTypes(): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList { + echo "supportingDocumentTypes is deprecated. Use v1->supportingDocumentTypes instead."; + return $this->v1->supportingDocumentTypes; + } + + /** + * @deprecated Use v1->supportingDocumentTypes(\$sid) instead. + * @param string $sid The unique string that identifies the Supporting Document + * Type resource + */ + protected function contextSupportingDocumentTypes(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext { + echo "supportingDocumentTypes(\$sid) is deprecated. Use v1->supportingDocumentTypes(\$sid) instead."; + return $this->v1->supportingDocumentTypes($sid); + } + + /** + * @deprecated Use v1->trustProducts instead. + */ + protected function getTrustProducts(): \Twilio\Rest\Trusthub\V1\TrustProductsList { + echo "trustProducts is deprecated. Use v1->trustProducts instead."; + return $this->v1->trustProducts; + } + + /** + * @deprecated Use v1->trustProducts(\$sid) instead. + * @param string $sid The unique string that identifies the resource. + */ + protected function contextTrustProducts(string $sid): \Twilio\Rest\Trusthub\V1\TrustProductsContext { + echo "trustProducts(\$sid) is deprecated. Use v1->trustProducts(\$sid) instead."; + return $this->v1->trustProducts($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1.php new file mode 100644 index 0000000..35a3710 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1.php @@ -0,0 +1,200 @@ +version = 'v1'; + } + + protected function getComplianceInquiries(): ComplianceInquiriesList + { + if (!$this->_complianceInquiries) { + $this->_complianceInquiries = new ComplianceInquiriesList($this); + } + return $this->_complianceInquiries; + } + + protected function getComplianceRegistrationInquiries(): ComplianceRegistrationInquiriesList + { + if (!$this->_complianceRegistrationInquiries) { + $this->_complianceRegistrationInquiries = new ComplianceRegistrationInquiriesList($this); + } + return $this->_complianceRegistrationInquiries; + } + + protected function getComplianceTollfreeInquiries(): ComplianceTollfreeInquiriesList + { + if (!$this->_complianceTollfreeInquiries) { + $this->_complianceTollfreeInquiries = new ComplianceTollfreeInquiriesList($this); + } + return $this->_complianceTollfreeInquiries; + } + + protected function getCustomerProfiles(): CustomerProfilesList + { + if (!$this->_customerProfiles) { + $this->_customerProfiles = new CustomerProfilesList($this); + } + return $this->_customerProfiles; + } + + protected function getEndUsers(): EndUserList + { + if (!$this->_endUsers) { + $this->_endUsers = new EndUserList($this); + } + return $this->_endUsers; + } + + protected function getEndUserTypes(): EndUserTypeList + { + if (!$this->_endUserTypes) { + $this->_endUserTypes = new EndUserTypeList($this); + } + return $this->_endUserTypes; + } + + protected function getPolicies(): PoliciesList + { + if (!$this->_policies) { + $this->_policies = new PoliciesList($this); + } + return $this->_policies; + } + + protected function getSupportingDocuments(): SupportingDocumentList + { + if (!$this->_supportingDocuments) { + $this->_supportingDocuments = new SupportingDocumentList($this); + } + return $this->_supportingDocuments; + } + + protected function getSupportingDocumentTypes(): SupportingDocumentTypeList + { + if (!$this->_supportingDocumentTypes) { + $this->_supportingDocumentTypes = new SupportingDocumentTypeList($this); + } + return $this->_supportingDocumentTypes; + } + + protected function getTrustProducts(): TrustProductsList + { + if (!$this->_trustProducts) { + $this->_trustProducts = new TrustProductsList($this); + } + return $this->_trustProducts; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Trusthub.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesContext.php new file mode 100644 index 0000000..a01c41d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesContext.php @@ -0,0 +1,89 @@ +solution = [ + 'customerId' => + $customerId, + ]; + + $this->uri = '/ComplianceInquiries/Customers/' . \rawurlencode($customerId) + .'/Initialize'; + } + + /** + * Update the ComplianceInquiriesInstance + * + * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $primaryProfileSid): ComplianceInquiriesInstance + { + + $data = Values::of([ + 'PrimaryProfileSid' => + $primaryProfileSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ComplianceInquiriesInstance( + $this->version, + $payload, + $this->solution['customerId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.ComplianceInquiriesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesInstance.php new file mode 100644 index 0000000..9370908 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesInstance.php @@ -0,0 +1,122 @@ +properties = [ + 'inquiryId' => Values::array_get($payload, 'inquiry_id'), + 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), + 'customerId' => Values::array_get($payload, 'customer_id'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerId' => $customerId ?: $this->properties['customerId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ComplianceInquiriesContext Context for this ComplianceInquiriesInstance + */ + protected function proxy(): ComplianceInquiriesContext + { + if (!$this->context) { + $this->context = new ComplianceInquiriesContext( + $this->version, + $this->solution['customerId'] + ); + } + + return $this->context; + } + + /** + * Update the ComplianceInquiriesInstance + * + * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $primaryProfileSid): ComplianceInquiriesInstance + { + + return $this->proxy()->update($primaryProfileSid); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.ComplianceInquiriesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesList.php new file mode 100644 index 0000000..b7181ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesList.php @@ -0,0 +1,100 @@ +solution = [ + ]; + + $this->uri = '/ComplianceInquiries/Customers/Initialize'; + } + + /** + * Create the ComplianceInquiriesInstance + * + * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + * @param array|Options $options Optional Arguments + * @return ComplianceInquiriesInstance Created ComplianceInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $primaryProfileSid, array $options = []): ComplianceInquiriesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PrimaryProfileSid' => + $primaryProfileSid, + 'NotificationEmail' => + $options['notificationEmail'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ComplianceInquiriesInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a ComplianceInquiriesContext + * + * @param string $customerId The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. + */ + public function getContext( + string $customerId + + ): ComplianceInquiriesContext + { + return new ComplianceInquiriesContext( + $this->version, + $customerId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceInquiriesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.php new file mode 100644 index 0000000..04a5724 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.php @@ -0,0 +1,78 @@ +options['notificationEmail'] = $notificationEmail; + } + + /** + * The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. + * + * @param string $notificationEmail The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. + * @return $this Fluent Builder + */ + public function setNotificationEmail(string $notificationEmail): self + { + $this->options['notificationEmail'] = $notificationEmail; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateComplianceInquiriesOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesPage.php new file mode 100644 index 0000000..92c306e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ComplianceInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceInquiriesInstance + */ + public function buildInstance(array $payload): ComplianceInquiriesInstance + { + return new ComplianceInquiriesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceInquiriesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php new file mode 100644 index 0000000..0355400 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php @@ -0,0 +1,95 @@ +solution = [ + 'registrationId' => + $registrationId, + ]; + + $this->uri = '/ComplianceInquiries/Registration/' . \rawurlencode($registrationId) + .'/RegulatoryCompliance/GB/Initialize'; + } + + /** + * Update the ComplianceRegistrationInquiriesInstance + * + * @param array|Options $options Optional Arguments + * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ComplianceRegistrationInquiriesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IsIsvEmbed' => + Serialize::booleanToString($options['isIsvEmbed']), + 'ThemeSetId' => + $options['themeSetId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ComplianceRegistrationInquiriesInstance( + $this->version, + $payload, + $this->solution['registrationId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php new file mode 100644 index 0000000..f0566ce --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'inquiryId' => Values::array_get($payload, 'inquiry_id'), + 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), + 'registrationId' => Values::array_get($payload, 'registration_id'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['registrationId' => $registrationId ?: $this->properties['registrationId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ComplianceRegistrationInquiriesContext Context for this ComplianceRegistrationInquiriesInstance + */ + protected function proxy(): ComplianceRegistrationInquiriesContext + { + if (!$this->context) { + $this->context = new ComplianceRegistrationInquiriesContext( + $this->version, + $this->solution['registrationId'] + ); + } + + return $this->context; + } + + /** + * Update the ComplianceRegistrationInquiriesInstance + * + * @param array|Options $options Optional Arguments + * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ComplianceRegistrationInquiriesInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php new file mode 100644 index 0000000..5b17226 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php @@ -0,0 +1,176 @@ +solution = [ + ]; + + $this->uri = '/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize'; + } + + /** + * Create the ComplianceRegistrationInquiriesInstance + * + * @param string $endUserType + * @param string $phoneNumberType + * @param array|Options $options Optional Arguments + * @return ComplianceRegistrationInquiriesInstance Created ComplianceRegistrationInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $endUserType, string $phoneNumberType, array $options = []): ComplianceRegistrationInquiriesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'EndUserType' => + $endUserType, + 'PhoneNumberType' => + $phoneNumberType, + 'BusinessIdentityType' => + $options['businessIdentityType'], + 'BusinessRegistrationAuthority' => + $options['businessRegistrationAuthority'], + 'BusinessLegalName' => + $options['businessLegalName'], + 'NotificationEmail' => + $options['notificationEmail'], + 'AcceptedNotificationReceipt' => + Serialize::booleanToString($options['acceptedNotificationReceipt']), + 'BusinessRegistrationNumber' => + $options['businessRegistrationNumber'], + 'BusinessWebsiteUrl' => + $options['businessWebsiteUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'AuthorizedRepresentative1FirstName' => + $options['authorizedRepresentative1FirstName'], + 'AuthorizedRepresentative1LastName' => + $options['authorizedRepresentative1LastName'], + 'AuthorizedRepresentative1Phone' => + $options['authorizedRepresentative1Phone'], + 'AuthorizedRepresentative1Email' => + $options['authorizedRepresentative1Email'], + 'AuthorizedRepresentative1DateOfBirth' => + $options['authorizedRepresentative1DateOfBirth'], + 'AddressStreet' => + $options['addressStreet'], + 'AddressStreetSecondary' => + $options['addressStreetSecondary'], + 'AddressCity' => + $options['addressCity'], + 'AddressSubdivision' => + $options['addressSubdivision'], + 'AddressPostalCode' => + $options['addressPostalCode'], + 'AddressCountryCode' => + $options['addressCountryCode'], + 'EmergencyAddressStreet' => + $options['emergencyAddressStreet'], + 'EmergencyAddressStreetSecondary' => + $options['emergencyAddressStreetSecondary'], + 'EmergencyAddressCity' => + $options['emergencyAddressCity'], + 'EmergencyAddressSubdivision' => + $options['emergencyAddressSubdivision'], + 'EmergencyAddressPostalCode' => + $options['emergencyAddressPostalCode'], + 'EmergencyAddressCountryCode' => + $options['emergencyAddressCountryCode'], + 'UseAddressAsEmergencyAddress' => + Serialize::booleanToString($options['useAddressAsEmergencyAddress']), + 'FileName' => + $options['fileName'], + 'File' => + $options['file'], + 'FirstName' => + $options['firstName'], + 'LastName' => + $options['lastName'], + 'DateOfBirth' => + $options['dateOfBirth'], + 'IndividualEmail' => + $options['individualEmail'], + 'IndividualPhone' => + $options['individualPhone'], + 'IsIsvEmbed' => + Serialize::booleanToString($options['isIsvEmbed']), + 'IsvRegisteringForSelfOrTenant' => + $options['isvRegisteringForSelfOrTenant'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'ThemeSetId' => + $options['themeSetId'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ComplianceRegistrationInquiriesInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a ComplianceRegistrationInquiriesContext + * + * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. + */ + public function getContext( + string $registrationId + + ): ComplianceRegistrationInquiriesContext + { + return new ComplianceRegistrationInquiriesContext( + $this->version, + $registrationId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php new file mode 100644 index 0000000..4c870b6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php @@ -0,0 +1,790 @@ +options['businessIdentityType'] = $businessIdentityType; + $this->options['businessRegistrationAuthority'] = $businessRegistrationAuthority; + $this->options['businessLegalName'] = $businessLegalName; + $this->options['notificationEmail'] = $notificationEmail; + $this->options['acceptedNotificationReceipt'] = $acceptedNotificationReceipt; + $this->options['businessRegistrationNumber'] = $businessRegistrationNumber; + $this->options['businessWebsiteUrl'] = $businessWebsiteUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['authorizedRepresentative1FirstName'] = $authorizedRepresentative1FirstName; + $this->options['authorizedRepresentative1LastName'] = $authorizedRepresentative1LastName; + $this->options['authorizedRepresentative1Phone'] = $authorizedRepresentative1Phone; + $this->options['authorizedRepresentative1Email'] = $authorizedRepresentative1Email; + $this->options['authorizedRepresentative1DateOfBirth'] = $authorizedRepresentative1DateOfBirth; + $this->options['addressStreet'] = $addressStreet; + $this->options['addressStreetSecondary'] = $addressStreetSecondary; + $this->options['addressCity'] = $addressCity; + $this->options['addressSubdivision'] = $addressSubdivision; + $this->options['addressPostalCode'] = $addressPostalCode; + $this->options['addressCountryCode'] = $addressCountryCode; + $this->options['emergencyAddressStreet'] = $emergencyAddressStreet; + $this->options['emergencyAddressStreetSecondary'] = $emergencyAddressStreetSecondary; + $this->options['emergencyAddressCity'] = $emergencyAddressCity; + $this->options['emergencyAddressSubdivision'] = $emergencyAddressSubdivision; + $this->options['emergencyAddressPostalCode'] = $emergencyAddressPostalCode; + $this->options['emergencyAddressCountryCode'] = $emergencyAddressCountryCode; + $this->options['useAddressAsEmergencyAddress'] = $useAddressAsEmergencyAddress; + $this->options['fileName'] = $fileName; + $this->options['file'] = $file; + $this->options['firstName'] = $firstName; + $this->options['lastName'] = $lastName; + $this->options['dateOfBirth'] = $dateOfBirth; + $this->options['individualEmail'] = $individualEmail; + $this->options['individualPhone'] = $individualPhone; + $this->options['isIsvEmbed'] = $isIsvEmbed; + $this->options['isvRegisteringForSelfOrTenant'] = $isvRegisteringForSelfOrTenant; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['themeSetId'] = $themeSetId; + } + + /** + * @param string $businessIdentityType + * @return $this Fluent Builder + */ + public function setBusinessIdentityType(string $businessIdentityType): self + { + $this->options['businessIdentityType'] = $businessIdentityType; + return $this; + } + + /** + * @param string $businessRegistrationAuthority + * @return $this Fluent Builder + */ + public function setBusinessRegistrationAuthority(string $businessRegistrationAuthority): self + { + $this->options['businessRegistrationAuthority'] = $businessRegistrationAuthority; + return $this; + } + + /** + * he name of the business or organization using the Tollfree number. + * + * @param string $businessLegalName he name of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessLegalName(string $businessLegalName): self + { + $this->options['businessLegalName'] = $businessLegalName; + return $this; + } + + /** + * he email address to receive the notification about the verification result. + * + * @param string $notificationEmail he email address to receive the notification about the verification result. + * @return $this Fluent Builder + */ + public function setNotificationEmail(string $notificationEmail): self + { + $this->options['notificationEmail'] = $notificationEmail; + return $this; + } + + /** + * The email address to receive the notification about the verification result. + * + * @param bool $acceptedNotificationReceipt The email address to receive the notification about the verification result. + * @return $this Fluent Builder + */ + public function setAcceptedNotificationReceipt(bool $acceptedNotificationReceipt): self + { + $this->options['acceptedNotificationReceipt'] = $acceptedNotificationReceipt; + return $this; + } + + /** + * Business registration number of the business + * + * @param string $businessRegistrationNumber Business registration number of the business + * @return $this Fluent Builder + */ + public function setBusinessRegistrationNumber(string $businessRegistrationNumber): self + { + $this->options['businessRegistrationNumber'] = $businessRegistrationNumber; + return $this; + } + + /** + * The URL of the business website + * + * @param string $businessWebsiteUrl The URL of the business website + * @return $this Fluent Builder + */ + public function setBusinessWebsiteUrl(string $businessWebsiteUrl): self + { + $this->options['businessWebsiteUrl'] = $businessWebsiteUrl; + return $this; + } + + /** + * Friendly name for your business information + * + * @param string $friendlyName Friendly name for your business information + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * First name of the authorized representative + * + * @param string $authorizedRepresentative1FirstName First name of the authorized representative + * @return $this Fluent Builder + */ + public function setAuthorizedRepresentative1FirstName(string $authorizedRepresentative1FirstName): self + { + $this->options['authorizedRepresentative1FirstName'] = $authorizedRepresentative1FirstName; + return $this; + } + + /** + * Last name of the authorized representative + * + * @param string $authorizedRepresentative1LastName Last name of the authorized representative + * @return $this Fluent Builder + */ + public function setAuthorizedRepresentative1LastName(string $authorizedRepresentative1LastName): self + { + $this->options['authorizedRepresentative1LastName'] = $authorizedRepresentative1LastName; + return $this; + } + + /** + * Phone number of the authorized representative + * + * @param string $authorizedRepresentative1Phone Phone number of the authorized representative + * @return $this Fluent Builder + */ + public function setAuthorizedRepresentative1Phone(string $authorizedRepresentative1Phone): self + { + $this->options['authorizedRepresentative1Phone'] = $authorizedRepresentative1Phone; + return $this; + } + + /** + * Email address of the authorized representative + * + * @param string $authorizedRepresentative1Email Email address of the authorized representative + * @return $this Fluent Builder + */ + public function setAuthorizedRepresentative1Email(string $authorizedRepresentative1Email): self + { + $this->options['authorizedRepresentative1Email'] = $authorizedRepresentative1Email; + return $this; + } + + /** + * Birthdate of the authorized representative + * + * @param string $authorizedRepresentative1DateOfBirth Birthdate of the authorized representative + * @return $this Fluent Builder + */ + public function setAuthorizedRepresentative1DateOfBirth(string $authorizedRepresentative1DateOfBirth): self + { + $this->options['authorizedRepresentative1DateOfBirth'] = $authorizedRepresentative1DateOfBirth; + return $this; + } + + /** + * Street address of the business + * + * @param string $addressStreet Street address of the business + * @return $this Fluent Builder + */ + public function setAddressStreet(string $addressStreet): self + { + $this->options['addressStreet'] = $addressStreet; + return $this; + } + + /** + * Street address of the business + * + * @param string $addressStreetSecondary Street address of the business + * @return $this Fluent Builder + */ + public function setAddressStreetSecondary(string $addressStreetSecondary): self + { + $this->options['addressStreetSecondary'] = $addressStreetSecondary; + return $this; + } + + /** + * City of the business + * + * @param string $addressCity City of the business + * @return $this Fluent Builder + */ + public function setAddressCity(string $addressCity): self + { + $this->options['addressCity'] = $addressCity; + return $this; + } + + /** + * State or province of the business + * + * @param string $addressSubdivision State or province of the business + * @return $this Fluent Builder + */ + public function setAddressSubdivision(string $addressSubdivision): self + { + $this->options['addressSubdivision'] = $addressSubdivision; + return $this; + } + + /** + * Postal code of the business + * + * @param string $addressPostalCode Postal code of the business + * @return $this Fluent Builder + */ + public function setAddressPostalCode(string $addressPostalCode): self + { + $this->options['addressPostalCode'] = $addressPostalCode; + return $this; + } + + /** + * Country code of the business + * + * @param string $addressCountryCode Country code of the business + * @return $this Fluent Builder + */ + public function setAddressCountryCode(string $addressCountryCode): self + { + $this->options['addressCountryCode'] = $addressCountryCode; + return $this; + } + + /** + * Street address of the business + * + * @param string $emergencyAddressStreet Street address of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressStreet(string $emergencyAddressStreet): self + { + $this->options['emergencyAddressStreet'] = $emergencyAddressStreet; + return $this; + } + + /** + * Street address of the business + * + * @param string $emergencyAddressStreetSecondary Street address of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressStreetSecondary(string $emergencyAddressStreetSecondary): self + { + $this->options['emergencyAddressStreetSecondary'] = $emergencyAddressStreetSecondary; + return $this; + } + + /** + * City of the business + * + * @param string $emergencyAddressCity City of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressCity(string $emergencyAddressCity): self + { + $this->options['emergencyAddressCity'] = $emergencyAddressCity; + return $this; + } + + /** + * State or province of the business + * + * @param string $emergencyAddressSubdivision State or province of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressSubdivision(string $emergencyAddressSubdivision): self + { + $this->options['emergencyAddressSubdivision'] = $emergencyAddressSubdivision; + return $this; + } + + /** + * Postal code of the business + * + * @param string $emergencyAddressPostalCode Postal code of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressPostalCode(string $emergencyAddressPostalCode): self + { + $this->options['emergencyAddressPostalCode'] = $emergencyAddressPostalCode; + return $this; + } + + /** + * Country code of the business + * + * @param string $emergencyAddressCountryCode Country code of the business + * @return $this Fluent Builder + */ + public function setEmergencyAddressCountryCode(string $emergencyAddressCountryCode): self + { + $this->options['emergencyAddressCountryCode'] = $emergencyAddressCountryCode; + return $this; + } + + /** + * Use the business address as the emergency address + * + * @param bool $useAddressAsEmergencyAddress Use the business address as the emergency address + * @return $this Fluent Builder + */ + public function setUseAddressAsEmergencyAddress(bool $useAddressAsEmergencyAddress): self + { + $this->options['useAddressAsEmergencyAddress'] = $useAddressAsEmergencyAddress; + return $this; + } + + /** + * The name of the verification document to upload + * + * @param string $fileName The name of the verification document to upload + * @return $this Fluent Builder + */ + public function setFileName(string $fileName): self + { + $this->options['fileName'] = $fileName; + return $this; + } + + /** + * The verification document to upload + * + * @param string $file The verification document to upload + * @return $this Fluent Builder + */ + public function setFile(string $file): self + { + $this->options['file'] = $file; + return $this; + } + + /** + * The first name of the Individual User. + * + * @param string $firstName The first name of the Individual User. + * @return $this Fluent Builder + */ + public function setFirstName(string $firstName): self + { + $this->options['firstName'] = $firstName; + return $this; + } + + /** + * The last name of the Individual User. + * + * @param string $lastName The last name of the Individual User. + * @return $this Fluent Builder + */ + public function setLastName(string $lastName): self + { + $this->options['lastName'] = $lastName; + return $this; + } + + /** + * The date of birth of the Individual User. + * + * @param string $dateOfBirth The date of birth of the Individual User. + * @return $this Fluent Builder + */ + public function setDateOfBirth(string $dateOfBirth): self + { + $this->options['dateOfBirth'] = $dateOfBirth; + return $this; + } + + /** + * The email address of the Individual User. + * + * @param string $individualEmail The email address of the Individual User. + * @return $this Fluent Builder + */ + public function setIndividualEmail(string $individualEmail): self + { + $this->options['individualEmail'] = $individualEmail; + return $this; + } + + /** + * The phone number of the Individual User. + * + * @param string $individualPhone The phone number of the Individual User. + * @return $this Fluent Builder + */ + public function setIndividualPhone(string $individualPhone): self + { + $this->options['individualPhone'] = $individualPhone; + return $this; + } + + /** + * Indicates if the inquiry is being started from an ISV embedded component. + * + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @return $this Fluent Builder + */ + public function setIsIsvEmbed(bool $isIsvEmbed): self + { + $this->options['isIsvEmbed'] = $isIsvEmbed; + return $this; + } + + /** + * Indicates if the isv registering for self or tenant. + * + * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. + * @return $this Fluent Builder + */ + public function setIsvRegisteringForSelfOrTenant(string $isvRegisteringForSelfOrTenant): self + { + $this->options['isvRegisteringForSelfOrTenant'] = $isvRegisteringForSelfOrTenant; + return $this; + } + + /** + * The url we call to inform you of bundle changes. + * + * @param string $statusCallbackUrl The url we call to inform you of bundle changes. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * Theme id for styling the inquiry form. + * + * @param string $themeSetId Theme id for styling the inquiry form. + * @return $this Fluent Builder + */ + public function setThemeSetId(string $themeSetId): self + { + $this->options['themeSetId'] = $themeSetId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateComplianceRegistrationInquiriesOptions ' . $options . ']'; + } +} + +class UpdateComplianceRegistrationInquiriesOptions extends Options + { + /** + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @param string $themeSetId Theme id for styling the inquiry form. + */ + public function __construct( + + bool $isIsvEmbed = Values::BOOL_NONE, + string $themeSetId = Values::NONE + + ) { + $this->options['isIsvEmbed'] = $isIsvEmbed; + $this->options['themeSetId'] = $themeSetId; + } + + /** + * Indicates if the inquiry is being started from an ISV embedded component. + * + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @return $this Fluent Builder + */ + public function setIsIsvEmbed(bool $isIsvEmbed): self + { + $this->options['isIsvEmbed'] = $isIsvEmbed; + return $this; + } + + /** + * Theme id for styling the inquiry form. + * + * @param string $themeSetId Theme id for styling the inquiry form. + * @return $this Fluent Builder + */ + public function setThemeSetId(string $themeSetId): self + { + $this->options['themeSetId'] = $themeSetId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateComplianceRegistrationInquiriesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesPage.php new file mode 100644 index 0000000..809b40a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ComplianceRegistrationInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceRegistrationInquiriesInstance + */ + public function buildInstance(array $payload): ComplianceRegistrationInquiriesInstance + { + return new ComplianceRegistrationInquiriesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesInstance.php new file mode 100644 index 0000000..4446d29 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesInstance.php @@ -0,0 +1,86 @@ +properties = [ + 'inquiryId' => Values::array_get($payload, 'inquiry_id'), + 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), + 'registrationId' => Values::array_get($payload, 'registration_id'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesList.php new file mode 100644 index 0000000..65982ab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesList.php @@ -0,0 +1,128 @@ +solution = [ + ]; + + $this->uri = '/ComplianceInquiries/Tollfree/Initialize'; + } + + /** + * Create the ComplianceTollfreeInquiriesInstance + * + * @param string $tollfreePhoneNumber The Tollfree phone number to be verified + * @param string $notificationEmail The email address to receive the notification about the verification result. + * @param array|Options $options Optional Arguments + * @return ComplianceTollfreeInquiriesInstance Created ComplianceTollfreeInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $tollfreePhoneNumber, string $notificationEmail, array $options = []): ComplianceTollfreeInquiriesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'TollfreePhoneNumber' => + $tollfreePhoneNumber, + 'NotificationEmail' => + $notificationEmail, + 'BusinessName' => + $options['businessName'], + 'BusinessWebsite' => + $options['businessWebsite'], + 'UseCaseCategories' => + Serialize::map($options['useCaseCategories'], function ($e) { return $e; }), + 'UseCaseSummary' => + $options['useCaseSummary'], + 'ProductionMessageSample' => + $options['productionMessageSample'], + 'OptInImageUrls' => + Serialize::map($options['optInImageUrls'], function ($e) { return $e; }), + 'OptInType' => + $options['optInType'], + 'MessageVolume' => + $options['messageVolume'], + 'BusinessStreetAddress' => + $options['businessStreetAddress'], + 'BusinessStreetAddress2' => + $options['businessStreetAddress2'], + 'BusinessCity' => + $options['businessCity'], + 'BusinessStateProvinceRegion' => + $options['businessStateProvinceRegion'], + 'BusinessPostalCode' => + $options['businessPostalCode'], + 'BusinessCountry' => + $options['businessCountry'], + 'AdditionalInformation' => + $options['additionalInformation'], + 'BusinessContactFirstName' => + $options['businessContactFirstName'], + 'BusinessContactLastName' => + $options['businessContactLastName'], + 'BusinessContactEmail' => + $options['businessContactEmail'], + 'BusinessContactPhone' => + $options['businessContactPhone'], + 'ThemeSetId' => + $options['themeSetId'], + 'SkipMessagingUseCase' => + Serialize::booleanToString($options['skipMessagingUseCase']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ComplianceTollfreeInquiriesInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.php new file mode 100644 index 0000000..41f115b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.php @@ -0,0 +1,434 @@ +options['businessName'] = $businessName; + $this->options['businessWebsite'] = $businessWebsite; + $this->options['useCaseCategories'] = $useCaseCategories; + $this->options['useCaseSummary'] = $useCaseSummary; + $this->options['productionMessageSample'] = $productionMessageSample; + $this->options['optInImageUrls'] = $optInImageUrls; + $this->options['optInType'] = $optInType; + $this->options['messageVolume'] = $messageVolume; + $this->options['businessStreetAddress'] = $businessStreetAddress; + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + $this->options['businessCity'] = $businessCity; + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + $this->options['businessPostalCode'] = $businessPostalCode; + $this->options['businessCountry'] = $businessCountry; + $this->options['additionalInformation'] = $additionalInformation; + $this->options['businessContactFirstName'] = $businessContactFirstName; + $this->options['businessContactLastName'] = $businessContactLastName; + $this->options['businessContactEmail'] = $businessContactEmail; + $this->options['businessContactPhone'] = $businessContactPhone; + $this->options['themeSetId'] = $themeSetId; + $this->options['skipMessagingUseCase'] = $skipMessagingUseCase; + } + + /** + * The name of the business or organization using the Tollfree number. + * + * @param string $businessName The name of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessName(string $businessName): self + { + $this->options['businessName'] = $businessName; + return $this; + } + + /** + * The website of the business or organization using the Tollfree number. + * + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessWebsite(string $businessWebsite): self + { + $this->options['businessWebsite'] = $businessWebsite; + return $this; + } + + /** + * The category of the use case for the Tollfree Number. List as many are applicable.. + * + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @return $this Fluent Builder + */ + public function setUseCaseCategories(array $useCaseCategories): self + { + $this->options['useCaseCategories'] = $useCaseCategories; + return $this; + } + + /** + * Use this to further explain how messaging is used by the business or organization. + * + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @return $this Fluent Builder + */ + public function setUseCaseSummary(string $useCaseSummary): self + { + $this->options['useCaseSummary'] = $useCaseSummary; + return $this; + } + + /** + * An example of message content, i.e. a sample message. + * + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @return $this Fluent Builder + */ + public function setProductionMessageSample(string $productionMessageSample): self + { + $this->options['productionMessageSample'] = $productionMessageSample; + return $this; + } + + /** + * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @return $this Fluent Builder + */ + public function setOptInImageUrls(array $optInImageUrls): self + { + $this->options['optInImageUrls'] = $optInImageUrls; + return $this; + } + + /** + * @param string $optInType + * @return $this Fluent Builder + */ + public function setOptInType(string $optInType): self + { + $this->options['optInType'] = $optInType; + return $this; + } + + /** + * Estimate monthly volume of messages from the Tollfree Number. + * + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @return $this Fluent Builder + */ + public function setMessageVolume(string $messageVolume): self + { + $this->options['messageVolume'] = $messageVolume; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress(string $businessStreetAddress): self + { + $this->options['businessStreetAddress'] = $businessStreetAddress; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress2(string $businessStreetAddress2): self + { + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + return $this; + } + + /** + * The city of the business or organization using the Tollfree number. + * + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCity(string $businessCity): self + { + $this->options['businessCity'] = $businessCity; + return $this; + } + + /** + * The state/province/region of the business or organization using the Tollfree number. + * + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self + { + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + return $this; + } + + /** + * The postal code of the business or organization using the Tollfree number. + * + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessPostalCode(string $businessPostalCode): self + { + $this->options['businessPostalCode'] = $businessPostalCode; + return $this; + } + + /** + * The country of the business or organization using the Tollfree number. + * + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCountry(string $businessCountry): self + { + $this->options['businessCountry'] = $businessCountry; + return $this; + } + + /** + * Additional information to be provided for verification. + * + * @param string $additionalInformation Additional information to be provided for verification. + * @return $this Fluent Builder + */ + public function setAdditionalInformation(string $additionalInformation): self + { + $this->options['additionalInformation'] = $additionalInformation; + return $this; + } + + /** + * The first name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactFirstName(string $businessContactFirstName): self + { + $this->options['businessContactFirstName'] = $businessContactFirstName; + return $this; + } + + /** + * The last name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactLastName(string $businessContactLastName): self + { + $this->options['businessContactLastName'] = $businessContactLastName; + return $this; + } + + /** + * The email address of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactEmail(string $businessContactEmail): self + { + $this->options['businessContactEmail'] = $businessContactEmail; + return $this; + } + + /** + * The phone number of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactPhone(string $businessContactPhone): self + { + $this->options['businessContactPhone'] = $businessContactPhone; + return $this; + } + + /** + * Theme id for styling the inquiry form. + * + * @param string $themeSetId Theme id for styling the inquiry form. + * @return $this Fluent Builder + */ + public function setThemeSetId(string $themeSetId): self + { + $this->options['themeSetId'] = $themeSetId; + return $this; + } + + /** + * Skip the messaging use case screen of the inquiry form. + * + * @param bool $skipMessagingUseCase Skip the messaging use case screen of the inquiry form. + * @return $this Fluent Builder + */ + public function setSkipMessagingUseCase(bool $skipMessagingUseCase): self + { + $this->options['skipMessagingUseCase'] = $skipMessagingUseCase; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateComplianceTollfreeInquiriesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesPage.php new file mode 100644 index 0000000..e0ca0ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ComplianceTollfreeInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceTollfreeInquiriesInstance + */ + public function buildInstance(array $payload): ComplianceTollfreeInquiriesInstance + { + return new ComplianceTollfreeInquiriesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php new file mode 100644 index 0000000..d17a813 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php @@ -0,0 +1,103 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/ChannelEndpointAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CustomerProfilesChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php new file mode 100644 index 0000000..2edee56 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), + 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesChannelEndpointAssignmentContext Context for this CustomerProfilesChannelEndpointAssignmentInstance + */ + protected function proxy(): CustomerProfilesChannelEndpointAssignmentContext + { + if (!$this->context) { + $this->context = new CustomerProfilesChannelEndpointAssignmentContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php new file mode 100644 index 0000000..39cf1e5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php @@ -0,0 +1,207 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/ChannelEndpointAssignments'; + } + + /** + * Create the CustomerProfilesChannelEndpointAssignmentInstance + * + * @param string $channelEndpointType The type of channel endpoint. eg: phone-number + * @param string $channelEndpointSid The SID of an channel endpoint + * @return CustomerProfilesChannelEndpointAssignmentInstance Created CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $channelEndpointType, string $channelEndpointSid): CustomerProfilesChannelEndpointAssignmentInstance + { + + $data = Values::of([ + 'ChannelEndpointType' => + $channelEndpointType, + 'ChannelEndpointSid' => + $channelEndpointSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CustomerProfilesChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesChannelEndpointAssignmentInstance 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 CustomerProfilesChannelEndpointAssignmentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesChannelEndpointAssignmentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesChannelEndpointAssignmentInstance 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 CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesChannelEndpointAssignmentPage + { + $options = new Values($options); + + $params = Values::of([ + 'ChannelEndpointSid' => + $options['channelEndpointSid'], + 'ChannelEndpointSids' => + $options['channelEndpointSids'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance + */ + public function getPage(string $targetUrl): CustomerProfilesChannelEndpointAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesChannelEndpointAssignmentContext + * + * @param string $sid The unique string that we created to identify the resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesChannelEndpointAssignmentContext + { + return new CustomerProfilesChannelEndpointAssignmentContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php new file mode 100644 index 0000000..37a2a49 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php @@ -0,0 +1,100 @@ +options['channelEndpointSid'] = $channelEndpointSid; + $this->options['channelEndpointSids'] = $channelEndpointSids; + } + + /** + * The SID of an channel endpoint + * + * @param string $channelEndpointSid The SID of an channel endpoint + * @return $this Fluent Builder + */ + public function setChannelEndpointSid(string $channelEndpointSid): self + { + $this->options['channelEndpointSid'] = $channelEndpointSid; + return $this; + } + + /** + * comma separated list of channel endpoint sids + * + * @param string $channelEndpointSids comma separated list of channel endpoint sids + * @return $this Fluent Builder + */ + public function setChannelEndpointSids(string $channelEndpointSids): self + { + $this->options['channelEndpointSids'] = $channelEndpointSids; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesChannelEndpointAssignmentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php new file mode 100644 index 0000000..ff1ff67 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentInstance + */ + public function buildInstance(array $payload): CustomerProfilesChannelEndpointAssignmentInstance + { + return new CustomerProfilesChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php new file mode 100644 index 0000000..d93859d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php @@ -0,0 +1,103 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/EntityAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CustomerProfilesEntityAssignmentsInstance + * + * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEntityAssignmentsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CustomerProfilesEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php new file mode 100644 index 0000000..eb86e96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesEntityAssignmentsContext Context for this CustomerProfilesEntityAssignmentsInstance + */ + protected function proxy(): CustomerProfilesEntityAssignmentsContext + { + if (!$this->context) { + $this->context = new CustomerProfilesEntityAssignmentsContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesEntityAssignmentsInstance + * + * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEntityAssignmentsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php new file mode 100644 index 0000000..6c5c6de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php @@ -0,0 +1,202 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/EntityAssignments'; + } + + /** + * Create the CustomerProfilesEntityAssignmentsInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return CustomerProfilesEntityAssignmentsInstance Created CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): CustomerProfilesEntityAssignmentsInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CustomerProfilesEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesEntityAssignmentsInstance 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 CustomerProfilesEntityAssignmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesEntityAssignmentsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesEntityAssignmentsInstance 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 CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesEntityAssignmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'ObjectType' => + $options['objectType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance + */ + public function getPage(string $targetUrl): CustomerProfilesEntityAssignmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesEntityAssignmentsContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesEntityAssignmentsContext + { + return new CustomerProfilesEntityAssignmentsContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php new file mode 100644 index 0000000..ad1765f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php @@ -0,0 +1,82 @@ +options['objectType'] = $objectType; + } + + /** + * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * + * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * @return $this Fluent Builder + */ + public function setObjectType(string $objectType): self + { + $this->options['objectType'] = $objectType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesEntityAssignmentsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php new file mode 100644 index 0000000..b670f23 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsInstance + */ + public function buildInstance(array $payload): CustomerProfilesEntityAssignmentsInstance + { + return new CustomerProfilesEntityAssignmentsInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php new file mode 100644 index 0000000..993aac2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php @@ -0,0 +1,89 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CustomerProfilesEvaluationsInstance + * + * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEvaluationsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CustomerProfilesEvaluationsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php new file mode 100644 index 0000000..e76cec4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesEvaluationsContext Context for this CustomerProfilesEvaluationsInstance + */ + protected function proxy(): CustomerProfilesEvaluationsContext + { + if (!$this->context) { + $this->context = new CustomerProfilesEvaluationsContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CustomerProfilesEvaluationsInstance + * + * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEvaluationsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php new file mode 100644 index 0000000..26254e8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php @@ -0,0 +1,195 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/Evaluations'; + } + + /** + * Create the CustomerProfilesEvaluationsInstance + * + * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. + * @return CustomerProfilesEvaluationsInstance Created CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $policySid): CustomerProfilesEvaluationsInstance + { + + $data = Values::of([ + 'PolicySid' => + $policySid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CustomerProfilesEvaluationsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesEvaluationsInstance 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 CustomerProfilesEvaluationsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesEvaluationsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesEvaluationsInstance 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 CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesEvaluationsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance + */ + public function getPage(string $targetUrl): CustomerProfilesEvaluationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesEvaluationsContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesEvaluationsContext + { + return new CustomerProfilesEvaluationsContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php new file mode 100644 index 0000000..8609d76 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesEvaluationsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsInstance + */ + public function buildInstance(array $payload): CustomerProfilesEvaluationsInstance + { + return new CustomerProfilesEvaluationsInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php new file mode 100644 index 0000000..857c0b2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php @@ -0,0 +1,228 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CustomerProfilesInstance + * + * @return CustomerProfilesInstance Fetched CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CustomerProfilesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CustomerProfilesInstance + * + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Updated CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CustomerProfilesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CustomerProfilesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the customerProfilesChannelEndpointAssignment + */ + protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList + { + if (!$this->_customerProfilesChannelEndpointAssignment) { + $this->_customerProfilesChannelEndpointAssignment = new CustomerProfilesChannelEndpointAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesChannelEndpointAssignment; + } + + /** + * Access the customerProfilesEntityAssignments + */ + protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList + { + if (!$this->_customerProfilesEntityAssignments) { + $this->_customerProfilesEntityAssignments = new CustomerProfilesEntityAssignmentsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesEntityAssignments; + } + + /** + * Access the customerProfilesEvaluations + */ + protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList + { + if (!$this->_customerProfilesEvaluations) { + $this->_customerProfilesEvaluations = new CustomerProfilesEvaluationsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesEvaluations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php new file mode 100644 index 0000000..1ca64a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php @@ -0,0 +1,197 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + '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'), + 'errors' => Values::array_get($payload, 'errors'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesContext Context for this CustomerProfilesInstance + */ + protected function proxy(): CustomerProfilesContext + { + if (!$this->context) { + $this->context = new CustomerProfilesContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesInstance + * + * @return CustomerProfilesInstance Fetched CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CustomerProfilesInstance + * + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Updated CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CustomerProfilesInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the customerProfilesChannelEndpointAssignment + */ + protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList + { + return $this->proxy()->customerProfilesChannelEndpointAssignment; + } + + /** + * Access the customerProfilesEntityAssignments + */ + protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList + { + return $this->proxy()->customerProfilesEntityAssignments; + } + + /** + * Access the customerProfilesEvaluations + */ + protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList + { + return $this->proxy()->customerProfilesEvaluations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php new file mode 100644 index 0000000..a315cc1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php @@ -0,0 +1,209 @@ +solution = [ + ]; + + $this->uri = '/CustomerProfiles'; + } + + /** + * Create the CustomerProfilesInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Created CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, string $policySid, array $options = []): CustomerProfilesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'PolicySid' => + $policySid, + 'StatusCallback' => + $options['statusCallback'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CustomerProfilesInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CustomerProfilesInstance 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 CustomerProfilesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesInstance 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 CustomerProfilesPage Page of CustomerProfilesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'PolicySid' => + $options['policySid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesPage Page of CustomerProfilesInstance + */ + public function getPage(string $targetUrl): CustomerProfilesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesContext + * + * @param string $sid The unique string that we created to identify the Customer-Profile resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesContext + { + return new CustomerProfilesContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php new file mode 100644 index 0000000..b292cd0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php @@ -0,0 +1,272 @@ +options['statusCallback'] = $statusCallback; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateCustomerProfilesOptions ' . $options . ']'; + } +} + + + +class ReadCustomerProfilesOptions extends Options + { + /** + * @param string $status The verification status of the Customer-Profile resource. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $policySid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['policySid'] = $policySid; + } + + /** + * The verification status of the Customer-Profile resource. + * + * @param string $status The verification status of the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a policy that is associated to the Customer-Profile resource. + * + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setPolicySid(string $policySid): self + { + $this->options['policySid'] = $policySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesOptions ' . $options . ']'; + } +} + +class UpdateCustomerProfilesOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Customer-Profile resource changes status. + * + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateCustomerProfilesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php new file mode 100644 index 0000000..ff9dd19 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesInstance \Twilio\Rest\Trusthub\V1\CustomerProfilesInstance + */ + public function buildInstance(array $payload): CustomerProfilesInstance + { + return new CustomerProfilesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserContext.php new file mode 100644 index 0000000..087489c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserContext.php @@ -0,0 +1,129 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/EndUsers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserInstance.php new file mode 100644 index 0000000..87d187f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserInstance.php @@ -0,0 +1,156 @@ +properties = [ + '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'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserContext Context for this EndUserInstance + */ + protected function proxy(): EndUserContext + { + if (!$this->context) { + $this->context = new EndUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserList.php new file mode 100644 index 0000000..b8f50f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/EndUsers'; + } + + /** + * Create the EndUserInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of end user of the Bundle resource - can be `individual` or `business`. + * @param array|Options $options Optional Arguments + * @return EndUserInstance Created EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EndUserInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EndUserInstance 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 EndUserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserInstance 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 EndUserPage Page of EndUserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserPage Page of EndUserInstance + */ + public function getPage(string $targetUrl): EndUserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserContext + * + * @param string $sid The unique string created by Twilio to identify the End User resource. + */ + public function getContext( + string $sid + + ): EndUserContext + { + return new EndUserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserOptions.php new file mode 100644 index 0000000..c2dfa22 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateEndUserOptions ' . $options . ']'; + } +} + + + + +class UpdateEndUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateEndUserOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserPage.php new file mode 100644 index 0000000..4a8c9a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserInstance \Twilio\Rest\Trusthub\V1\EndUserInstance + */ + public function buildInstance(array $payload): EndUserInstance + { + return new EndUserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php new file mode 100644 index 0000000..039a2b3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/EndUserTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EndUserTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php new file mode 100644 index 0000000..240f0f9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserTypeContext Context for this EndUserTypeInstance + */ + protected function proxy(): EndUserTypeContext + { + if (!$this->context) { + $this->context = new EndUserTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeList.php new file mode 100644 index 0000000..025ae83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/EndUserTypes'; + } + + /** + * Reads EndUserTypeInstance 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 EndUserTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserTypeInstance 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 EndUserTypePage Page of EndUserTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function getPage(string $targetUrl): EndUserTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserTypeContext + * + * @param string $sid The unique string that identifies the End-User Type resource. + */ + public function getContext( + string $sid + + ): EndUserTypeContext + { + return new EndUserTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypePage.php new file mode 100644 index 0000000..66d6943 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserTypeInstance \Twilio\Rest\Trusthub\V1\EndUserTypeInstance + */ + public function buildInstance(array $payload): EndUserTypeInstance + { + return new EndUserTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php new file mode 100644 index 0000000..63e99c1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Policies/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PoliciesInstance + * + * @return PoliciesInstance Fetched PoliciesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PoliciesInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new PoliciesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.PoliciesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesInstance.php new file mode 100644 index 0000000..dd5bea2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'requirements' => Values::array_get($payload, 'requirements'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PoliciesContext Context for this PoliciesInstance + */ + protected function proxy(): PoliciesContext + { + if (!$this->context) { + $this->context = new PoliciesContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PoliciesInstance + * + * @return PoliciesInstance Fetched PoliciesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PoliciesInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.PoliciesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesList.php new file mode 100644 index 0000000..2641d0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Policies'; + } + + /** + * Reads PoliciesInstance 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 PoliciesInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PoliciesInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PoliciesInstance 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 PoliciesPage Page of PoliciesInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PoliciesPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PoliciesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PoliciesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PoliciesPage Page of PoliciesInstance + */ + public function getPage(string $targetUrl): PoliciesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PoliciesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PoliciesContext + * + * @param string $sid The unique string that identifies the Policy resource. + */ + public function getContext( + string $sid + + ): PoliciesContext + { + return new PoliciesContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.PoliciesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesPage.php new file mode 100644 index 0000000..ab76c6a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/PoliciesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PoliciesInstance \Twilio\Rest\Trusthub\V1\PoliciesInstance + */ + public function buildInstance(array $payload): PoliciesInstance + { + return new PoliciesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.PoliciesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php new file mode 100644 index 0000000..f9d97be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php @@ -0,0 +1,129 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SupportingDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php new file mode 100644 index 0000000..9dd8325 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'mimeType' => Values::array_get($payload, 'mime_type'), + 'status' => Values::array_get($payload, 'status'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentContext Context for this SupportingDocumentInstance + */ + protected function proxy(): SupportingDocumentContext + { + if (!$this->context) { + $this->context = new SupportingDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php new file mode 100644 index 0000000..7375ce6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/SupportingDocuments'; + } + + /** + * Create the SupportingDocumentInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of the Supporting Document. + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Created SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SupportingDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SupportingDocumentInstance 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 SupportingDocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentInstance 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 SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function getPage(string $targetUrl): SupportingDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentContext + * + * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentContext + { + return new SupportingDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php new file mode 100644 index 0000000..0b04255 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateSupportingDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateSupportingDocumentOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateSupportingDocumentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php new file mode 100644 index 0000000..494cd20 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentInstance + */ + public function buildInstance(array $payload): SupportingDocumentInstance + { + return new SupportingDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php new file mode 100644 index 0000000..41d12d7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SupportingDocumentTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SupportingDocumentTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php new file mode 100644 index 0000000..95b4017 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance + */ + protected function proxy(): SupportingDocumentTypeContext + { + if (!$this->context) { + $this->context = new SupportingDocumentTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php new file mode 100644 index 0000000..08d069a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/SupportingDocumentTypes'; + } + + /** + * Reads SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentTypeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentTypeInstance 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 SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function getPage(string $targetUrl): SupportingDocumentTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentTypeContext + * + * @param string $sid The unique string that identifies the Supporting Document Type resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentTypeContext + { + return new SupportingDocumentTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentTypeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php new file mode 100644 index 0000000..1f2d303 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentTypeInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeInstance + */ + public function buildInstance(array $payload): SupportingDocumentTypeInstance + { + return new SupportingDocumentTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentTypePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php new file mode 100644 index 0000000..883a773 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php @@ -0,0 +1,103 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/ChannelEndpointAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TrustProductsChannelEndpointAssignmentInstance + * + * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsChannelEndpointAssignmentInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrustProductsChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php new file mode 100644 index 0000000..c17a539 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), + 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsChannelEndpointAssignmentContext Context for this TrustProductsChannelEndpointAssignmentInstance + */ + protected function proxy(): TrustProductsChannelEndpointAssignmentContext + { + if (!$this->context) { + $this->context = new TrustProductsChannelEndpointAssignmentContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsChannelEndpointAssignmentInstance + * + * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsChannelEndpointAssignmentInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php new file mode 100644 index 0000000..d854288 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php @@ -0,0 +1,207 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/ChannelEndpointAssignments'; + } + + /** + * Create the TrustProductsChannelEndpointAssignmentInstance + * + * @param string $channelEndpointType The type of channel endpoint. eg: phone-number + * @param string $channelEndpointSid The SID of an channel endpoint + * @return TrustProductsChannelEndpointAssignmentInstance Created TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $channelEndpointType, string $channelEndpointSid): TrustProductsChannelEndpointAssignmentInstance + { + + $data = Values::of([ + 'ChannelEndpointType' => + $channelEndpointType, + 'ChannelEndpointSid' => + $channelEndpointSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TrustProductsChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsChannelEndpointAssignmentInstance 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 TrustProductsChannelEndpointAssignmentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TrustProductsChannelEndpointAssignmentInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsChannelEndpointAssignmentInstance 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 TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsChannelEndpointAssignmentPage + { + $options = new Values($options); + + $params = Values::of([ + 'ChannelEndpointSid' => + $options['channelEndpointSid'], + 'ChannelEndpointSids' => + $options['channelEndpointSids'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance + */ + public function getPage(string $targetUrl): TrustProductsChannelEndpointAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsChannelEndpointAssignmentContext + * + * @param string $sid The unique string that we created to identify the resource. + */ + public function getContext( + string $sid + + ): TrustProductsChannelEndpointAssignmentContext + { + return new TrustProductsChannelEndpointAssignmentContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php new file mode 100644 index 0000000..5189e2d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php @@ -0,0 +1,100 @@ +options['channelEndpointSid'] = $channelEndpointSid; + $this->options['channelEndpointSids'] = $channelEndpointSids; + } + + /** + * The SID of an channel endpoint + * + * @param string $channelEndpointSid The SID of an channel endpoint + * @return $this Fluent Builder + */ + public function setChannelEndpointSid(string $channelEndpointSid): self + { + $this->options['channelEndpointSid'] = $channelEndpointSid; + return $this; + } + + /** + * comma separated list of channel endpoint sids + * + * @param string $channelEndpointSids comma separated list of channel endpoint sids + * @return $this Fluent Builder + */ + public function setChannelEndpointSids(string $channelEndpointSids): self + { + $this->options['channelEndpointSids'] = $channelEndpointSids; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsChannelEndpointAssignmentOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php new file mode 100644 index 0000000..5992af7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentInstance + */ + public function buildInstance(array $payload): TrustProductsChannelEndpointAssignmentInstance + { + return new TrustProductsChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php new file mode 100644 index 0000000..6c98629 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php @@ -0,0 +1,103 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/EntityAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TrustProductsEntityAssignmentsInstance + * + * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEntityAssignmentsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrustProductsEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php new file mode 100644 index 0000000..2483e6f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsEntityAssignmentsContext Context for this TrustProductsEntityAssignmentsInstance + */ + protected function proxy(): TrustProductsEntityAssignmentsContext + { + if (!$this->context) { + $this->context = new TrustProductsEntityAssignmentsContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsEntityAssignmentsInstance + * + * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEntityAssignmentsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php new file mode 100644 index 0000000..d3c516f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php @@ -0,0 +1,202 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/EntityAssignments'; + } + + /** + * Create the TrustProductsEntityAssignmentsInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return TrustProductsEntityAssignmentsInstance Created TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): TrustProductsEntityAssignmentsInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TrustProductsEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsEntityAssignmentsInstance 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 TrustProductsEntityAssignmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TrustProductsEntityAssignmentsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsEntityAssignmentsInstance 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 TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsEntityAssignmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'ObjectType' => + $options['objectType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance + */ + public function getPage(string $targetUrl): TrustProductsEntityAssignmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsEntityAssignmentsContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): TrustProductsEntityAssignmentsContext + { + return new TrustProductsEntityAssignmentsContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php new file mode 100644 index 0000000..5b16480 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php @@ -0,0 +1,82 @@ +options['objectType'] = $objectType; + } + + /** + * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * + * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * @return $this Fluent Builder + */ + public function setObjectType(string $objectType): self + { + $this->options['objectType'] = $objectType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsEntityAssignmentsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php new file mode 100644 index 0000000..0b5173b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsInstance + */ + public function buildInstance(array $payload): TrustProductsEntityAssignmentsInstance + { + return new TrustProductsEntityAssignmentsInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php new file mode 100644 index 0000000..b0f86bf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php @@ -0,0 +1,89 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the TrustProductsEvaluationsInstance + * + * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEvaluationsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrustProductsEvaluationsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php new file mode 100644 index 0000000..4d76b53 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsEvaluationsContext Context for this TrustProductsEvaluationsInstance + */ + protected function proxy(): TrustProductsEvaluationsContext + { + if (!$this->context) { + $this->context = new TrustProductsEvaluationsContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TrustProductsEvaluationsInstance + * + * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEvaluationsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php new file mode 100644 index 0000000..d4766a6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php @@ -0,0 +1,195 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/Evaluations'; + } + + /** + * Create the TrustProductsEvaluationsInstance + * + * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. + * @return TrustProductsEvaluationsInstance Created TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $policySid): TrustProductsEvaluationsInstance + { + + $data = Values::of([ + 'PolicySid' => + $policySid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TrustProductsEvaluationsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsEvaluationsInstance 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 TrustProductsEvaluationsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TrustProductsEvaluationsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsEvaluationsInstance 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 TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsEvaluationsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance + */ + public function getPage(string $targetUrl): TrustProductsEvaluationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsEvaluationsContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): TrustProductsEvaluationsContext + { + return new TrustProductsEvaluationsContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php new file mode 100644 index 0000000..7267bde --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsEvaluationsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsInstance + */ + public function buildInstance(array $payload): TrustProductsEvaluationsInstance + { + return new TrustProductsEvaluationsInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php new file mode 100644 index 0000000..e9bb156 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php @@ -0,0 +1,228 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TrustProductsInstance + * + * @return TrustProductsInstance Fetched TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new TrustProductsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TrustProductsInstance + * + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Updated TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrustProductsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TrustProductsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the trustProductsChannelEndpointAssignment + */ + protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList + { + if (!$this->_trustProductsChannelEndpointAssignment) { + $this->_trustProductsChannelEndpointAssignment = new TrustProductsChannelEndpointAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsChannelEndpointAssignment; + } + + /** + * Access the trustProductsEvaluations + */ + protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList + { + if (!$this->_trustProductsEvaluations) { + $this->_trustProductsEvaluations = new TrustProductsEvaluationsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsEvaluations; + } + + /** + * Access the trustProductsEntityAssignments + */ + protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList + { + if (!$this->_trustProductsEntityAssignments) { + $this->_trustProductsEntityAssignments = new TrustProductsEntityAssignmentsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsEntityAssignments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php new file mode 100644 index 0000000..76e3b5a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php @@ -0,0 +1,197 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + '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'), + 'errors' => Values::array_get($payload, 'errors'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsContext Context for this TrustProductsInstance + */ + protected function proxy(): TrustProductsContext + { + if (!$this->context) { + $this->context = new TrustProductsContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsInstance + * + * @return TrustProductsInstance Fetched TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrustProductsInstance + * + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Updated TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrustProductsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the trustProductsChannelEndpointAssignment + */ + protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList + { + return $this->proxy()->trustProductsChannelEndpointAssignment; + } + + /** + * Access the trustProductsEvaluations + */ + protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList + { + return $this->proxy()->trustProductsEvaluations; + } + + /** + * Access the trustProductsEntityAssignments + */ + protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList + { + return $this->proxy()->trustProductsEntityAssignments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php new file mode 100644 index 0000000..a299887 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php @@ -0,0 +1,209 @@ +solution = [ + ]; + + $this->uri = '/TrustProducts'; + } + + /** + * Create the TrustProductsInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Trust Product resource changes status. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Created TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, string $policySid, array $options = []): TrustProductsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'PolicySid' => + $policySid, + 'StatusCallback' => + $options['statusCallback'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TrustProductsInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TrustProductsInstance 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 TrustProductsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TrustProductsInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsInstance 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 TrustProductsPage Page of TrustProductsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'PolicySid' => + $options['policySid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsPage Page of TrustProductsInstance + */ + public function getPage(string $targetUrl): TrustProductsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsContext + * + * @param string $sid The unique string that we created to identify the Trust Product resource. + */ + public function getContext( + string $sid + + ): TrustProductsContext + { + return new TrustProductsContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php new file mode 100644 index 0000000..7331260 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php @@ -0,0 +1,272 @@ +options['statusCallback'] = $statusCallback; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateTrustProductsOptions ' . $options . ']'; + } +} + + + +class ReadTrustProductsOptions extends Options + { + /** + * @param string $status The verification status of the Trust Product resource. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $policySid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['policySid'] = $policySid; + } + + /** + * The verification status of the Trust Product resource. + * + * @param string $status The verification status of the Trust Product resource. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a policy that is associated to the Trust Product resource. + * + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. + * @return $this Fluent Builder + */ + public function setPolicySid(string $policySid): self + { + $this->options['policySid'] = $policySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsOptions ' . $options . ']'; + } +} + +class UpdateTrustProductsOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Trust Product resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Trust Product resource changes status. + * + * @param string $email The email address that will receive updates when the Trust Product resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateTrustProductsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsPage.php new file mode 100644 index 0000000..952e73f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsInstance \Twilio\Rest\Trusthub\V1\TrustProductsInstance + */ + public function buildInstance(array $payload): TrustProductsInstance + { + return new TrustProductsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/TrusthubBase.php b/vendor/twilio/sdk/src/Twilio/Rest/TrusthubBase.php new file mode 100644 index 0000000..de54500 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/TrusthubBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://trusthub.twilio.com'; + } + + + /** + * @return V1 Version v1 of trusthub + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Trusthub]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify.php new file mode 100644 index 0000000..3d5de3f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify.php @@ -0,0 +1,99 @@ +forms instead. + */ + protected function getForms(): \Twilio\Rest\Verify\V2\FormList { + echo "forms is deprecated. Use v2->forms instead."; + return $this->v2->forms; + } + + /** + * @deprecated Use v2->forms(\$formType) instead. + * @param string $formType The Type of this Form + */ + protected function contextForms(string $formType): \Twilio\Rest\Verify\V2\FormContext { + echo "forms(\$formType) is deprecated. Use v2->forms(\$formType) instead."; + return $this->v2->forms($formType); + } + + /** + * @deprecated Use v2->safelist instead. + */ + protected function getSafelist(): \Twilio\Rest\Verify\V2\SafelistList { + echo "safelist is deprecated. Use v2->safelist instead."; + return $this->v2->safelist; + } + + /** + * @deprecated Use v2->safelist(\$phoneNumber) instead. + * @param string $phoneNumber The phone number to be fetched from SafeList. + */ + protected function contextSafelist(string $phoneNumber): \Twilio\Rest\Verify\V2\SafelistContext { + echo "safelist(\$phoneNumber) is deprecated. Use v2->safelist(\$phoneNumber) instead."; + return $this->v2->safelist($phoneNumber); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\Verify\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Verify\V2\ServiceContext { + echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } + + /** + * @deprecated Use v2->verificationAttempts instead. + */ + protected function getVerificationAttempts(): \Twilio\Rest\Verify\V2\VerificationAttemptList { + echo "verificationAttempts is deprecated. Use v2->verificationAttempts instead."; + return $this->v2->verificationAttempts; + } + + /** + * @deprecated Use v2->verificationAttempts(\$sid) instead. + * @param string $sid Verification Attempt Sid. + */ + protected function contextVerificationAttempts(string $sid): \Twilio\Rest\Verify\V2\VerificationAttemptContext { + echo "verificationAttempts(\$sid) is deprecated. Use v2->verificationAttempts(\$sid) instead."; + return $this->v2->verificationAttempts($sid); + } + + /** + * @deprecated Use v2->verificationAttemptsSummary instead. + */ + protected function getVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList { + echo "verificationAttemptsSummary is deprecated. Use v2->verificationAttemptsSummary instead."; + return $this->v2->verificationAttemptsSummary; + } + + /** + * @deprecated Use v2->verificationAttemptsSummary() instead. + */ + protected function contextVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryContext { + echo "verificationAttemptsSummary() is deprecated. Use v2->verificationAttemptsSummary() instead."; + return $this->v2->verificationAttemptsSummary(); + } + + /** + * @deprecated Use v2->templates instead. + */ + protected function getTemplates(): \Twilio\Rest\Verify\V2\TemplateList { + echo "templates is deprecated. Use v2->templates instead."; + return $this->v2->templates; + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2.php new file mode 100644 index 0000000..df5e34f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2.php @@ -0,0 +1,153 @@ +version = 'v2'; + } + + protected function getForms(): FormList + { + if (!$this->_forms) { + $this->_forms = new FormList($this); + } + return $this->_forms; + } + + protected function getSafelist(): SafelistList + { + if (!$this->_safelist) { + $this->_safelist = new SafelistList($this); + } + return $this->_safelist; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getTemplates(): TemplateList + { + if (!$this->_templates) { + $this->_templates = new TemplateList($this); + } + return $this->_templates; + } + + protected function getVerificationAttempts(): VerificationAttemptList + { + if (!$this->_verificationAttempts) { + $this->_verificationAttempts = new VerificationAttemptList($this); + } + return $this->_verificationAttempts; + } + + protected function getVerificationAttemptsSummary(): VerificationAttemptsSummaryList + { + if (!$this->_verificationAttemptsSummary) { + $this->_verificationAttemptsSummary = new VerificationAttemptsSummaryList($this); + } + return $this->_verificationAttemptsSummary; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Verify.V2]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormContext.php new file mode 100644 index 0000000..e868ede --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormContext.php @@ -0,0 +1,83 @@ +solution = [ + 'formType' => + $formType, + ]; + + $this->uri = '/Forms/' . \rawurlencode($formType) + .''; + } + + /** + * Fetch the FormInstance + * + * @return FormInstance Fetched FormInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FormInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FormInstance( + $this->version, + $payload, + $this->solution['formType'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FormContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormInstance.php new file mode 100644 index 0000000..3a1f4c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'formType' => Values::array_get($payload, 'form_type'), + 'forms' => Values::array_get($payload, 'forms'), + 'formMeta' => Values::array_get($payload, 'form_meta'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['formType' => $formType ?: $this->properties['formType'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FormContext Context for this FormInstance + */ + protected function proxy(): FormContext + { + if (!$this->context) { + $this->context = new FormContext( + $this->version, + $this->solution['formType'] + ); + } + + return $this->context; + } + + /** + * Fetch the FormInstance + * + * @return FormInstance Fetched FormInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FormInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FormInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormList.php new file mode 100644 index 0000000..5aa7e4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a FormContext + * + * @param string $formType The Type of this Form. Currently only `form-push` is supported. + */ + public function getContext( + string $formType + + ): FormContext + { + return new FormContext( + $this->version, + $formType + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FormList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormPage.php new file mode 100644 index 0000000..bcd906e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/FormPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FormInstance \Twilio\Rest\Verify\V2\FormInstance + */ + public function buildInstance(array $payload): FormInstance + { + return new FormInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FormPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistContext.php new file mode 100644 index 0000000..7e81bc8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistContext.php @@ -0,0 +1,97 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/SafeList/Numbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Delete the SafelistInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SafelistInstance + * + * @return SafelistInstance Fetched SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SafelistInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SafelistInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.SafelistContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistInstance.php new file mode 100644 index 0000000..648f72a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 SafelistContext Context for this SafelistInstance + */ + protected function proxy(): SafelistContext + { + if (!$this->context) { + $this->context = new SafelistContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Delete the SafelistInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SafelistInstance + * + * @return SafelistInstance Fetched SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SafelistInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.SafelistInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistList.php new file mode 100644 index 0000000..66fd912 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistList.php @@ -0,0 +1,94 @@ +solution = [ + ]; + + $this->uri = '/SafeList/Numbers'; + } + + /** + * Create the SafelistInstance + * + * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return SafelistInstance Created SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber): SafelistInstance + { + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SafelistInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a SafelistContext + * + * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + */ + public function getContext( + string $phoneNumber + + ): SafelistContext + { + return new SafelistContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.SafelistList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistPage.php new file mode 100644 index 0000000..811d248 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/SafelistPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SafelistInstance \Twilio\Rest\Verify\V2\SafelistInstance + */ + public function buildInstance(array $payload): SafelistInstance + { + return new SafelistInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.SafelistPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php new file mode 100644 index 0000000..00f67b8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php @@ -0,0 +1,89 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AccessTokens/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AccessTokenInstance + * + * @return AccessTokenInstance Fetched AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccessTokenInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new AccessTokenInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.AccessTokenContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php new file mode 100644 index 0000000..a38874a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entityIdentity' => Values::array_get($payload, 'entity_identity'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'factorFriendlyName' => Values::array_get($payload, 'factor_friendly_name'), + 'token' => Values::array_get($payload, 'token'), + 'url' => Values::array_get($payload, 'url'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['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 AccessTokenContext Context for this AccessTokenInstance + */ + protected function proxy(): AccessTokenContext + { + if (!$this->context) { + $this->context = new AccessTokenContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AccessTokenInstance + * + * @return AccessTokenInstance Fetched AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccessTokenInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.AccessTokenInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenList.php new file mode 100644 index 0000000..049268b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenList.php @@ -0,0 +1,113 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AccessTokens'; + } + + /** + * Create the AccessTokenInstance + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID. + * @param string $factorType + * @param array|Options $options Optional Arguments + * @return AccessTokenInstance Created AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, string $factorType, array $options = []): AccessTokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FactorType' => + $factorType, + 'FactorFriendlyName' => + $options['factorFriendlyName'], + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AccessTokenInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Constructs a AccessTokenContext + * + * @param string $sid A 34 character string that uniquely identifies this Access Token. + */ + public function getContext( + string $sid + + ): AccessTokenContext + { + return new AccessTokenContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.AccessTokenList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php new file mode 100644 index 0000000..7f03e32 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php @@ -0,0 +1,96 @@ +options['factorFriendlyName'] = $factorFriendlyName; + $this->options['ttl'] = $ttl; + } + + /** + * The friendly name of the factor that is going to be created with this access token + * + * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token + * @return $this Fluent Builder + */ + public function setFactorFriendlyName(string $factorFriendlyName): self + { + $this->options['factorFriendlyName'] = $factorFriendlyName; + return $this; + } + + /** + * How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. + * + * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateAccessTokenOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php new file mode 100644 index 0000000..fbbcc01 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccessTokenInstance \Twilio\Rest\Verify\V2\Service\AccessTokenInstance + */ + public function buildInstance(array $payload): AccessTokenInstance + { + return new AccessTokenInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.AccessTokenPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php new file mode 100644 index 0000000..8269e7a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'challengeSid' => Values::array_get($payload, 'challenge_sid'), + 'priority' => Values::array_get($payload, 'priority'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php new file mode 100644 index 0000000..2e24897 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php @@ -0,0 +1,102 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + 'challengeSid' => + $challengeSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges/' . \rawurlencode($challengeSid) + .'/Notifications'; + } + + /** + * Create the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Created NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['challengeSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php new file mode 100644 index 0000000..7375308 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php @@ -0,0 +1,76 @@ +options['ttl'] = $ttl; + } + + /** + * How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. + * + * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateNotificationOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php new file mode 100644 index 0000000..33dfe68 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php new file mode 100644 index 0000000..265d9cd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php @@ -0,0 +1,188 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ChallengeInstance + * + * @return ChallengeInstance Fetched ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChallengeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChallengeInstance + * + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Updated ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChallengeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthPayload' => + $options['authPayload'], + 'Metadata' => + Serialize::jsonObject($options['metadata']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ChallengeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php new file mode 100644 index 0000000..e7a1759 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php @@ -0,0 +1,179 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'factorSid' => Values::array_get($payload, 'factor_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateResponded' => Deserialize::dateTime(Values::array_get($payload, 'date_responded')), + 'expirationDate' => Deserialize::dateTime(Values::array_get($payload, 'expiration_date')), + 'status' => Values::array_get($payload, 'status'), + 'respondedReason' => Values::array_get($payload, 'responded_reason'), + 'details' => Values::array_get($payload, 'details'), + 'hiddenDetails' => Values::array_get($payload, 'hidden_details'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 ChallengeContext Context for this ChallengeInstance + */ + protected function proxy(): ChallengeContext + { + if (!$this->context) { + $this->context = new ChallengeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ChallengeInstance + * + * @return ChallengeInstance Fetched ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChallengeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChallengeInstance + * + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Updated ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChallengeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ChallengeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php new file mode 100644 index 0000000..114067b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php @@ -0,0 +1,228 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges'; + } + + /** + * Create the ChallengeInstance + * + * @param string $factorSid The unique SID identifier of the Factor. + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Created ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $factorSid, array $options = []): ChallengeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FactorSid' => + $factorSid, + 'ExpirationDate' => + Serialize::iso8601DateTime($options['expirationDate']), + 'Details.Message' => + $options['detailsMessage'], + 'Details.Fields' => + Serialize::map($options['detailsFields'], function ($e) { return Serialize::jsonObject($e); }), + 'HiddenDetails' => + Serialize::jsonObject($options['hiddenDetails']), + 'AuthPayload' => + $options['authPayload'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Reads ChallengeInstance 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 ChallengeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChallengeInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChallengeInstance 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 ChallengePage Page of ChallengeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChallengePage + { + $options = new Values($options); + + $params = Values::of([ + 'FactorSid' => + $options['factorSid'], + 'Status' => + $options['status'], + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChallengePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChallengeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChallengePage Page of ChallengeInstance + */ + public function getPage(string $targetUrl): ChallengePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChallengePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChallengeContext + * + * @param string $sid A 34 character string that uniquely identifies this Challenge. + */ + public function getContext( + string $sid + + ): ChallengeContext + { + return new ChallengeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ChallengeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php new file mode 100644 index 0000000..b277ef7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php @@ -0,0 +1,308 @@ +options['expirationDate'] = $expirationDate; + $this->options['detailsMessage'] = $detailsMessage; + $this->options['detailsFields'] = $detailsFields; + $this->options['hiddenDetails'] = $hiddenDetails; + $this->options['authPayload'] = $authPayload; + } + + /** + * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. + * + * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. + * @return $this Fluent Builder + */ + public function setExpirationDate(\DateTime $expirationDate): self + { + $this->options['expirationDate'] = $expirationDate; + return $this; + } + + /** + * Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length + * + * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length + * @return $this Fluent Builder + */ + public function setDetailsMessage(string $detailsMessage): self + { + $this->options['detailsMessage'] = $detailsMessage; + return $this; + } + + /** + * A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. + * + * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. + * @return $this Fluent Builder + */ + public function setDetailsFields(array $detailsFields): self + { + $this->options['detailsFields'] = $detailsFields; + return $this; + } + + /** + * Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length + * + * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length + * @return $this Fluent Builder + */ + public function setHiddenDetails(array $hiddenDetails): self + { + $this->options['hiddenDetails'] = $hiddenDetails; + return $this; + } + + /** + * Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. + * + * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateChallengeOptions ' . $options . ']'; + } +} + + +class ReadChallengeOptions extends Options + { + /** + * @param string $factorSid The unique SID identifier of the Factor. + * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + */ + public function __construct( + + string $factorSid = Values::NONE, + string $status = Values::NONE, + string $order = Values::NONE + + ) { + $this->options['factorSid'] = $factorSid; + $this->options['status'] = $status; + $this->options['order'] = $order; + } + + /** + * The unique SID identifier of the Factor. + * + * @param string $factorSid The unique SID identifier of the Factor. + * @return $this Fluent Builder + */ + public function setFactorSid(string $factorSid): self + { + $this->options['factorSid'] = $factorSid; + return $this; + } + + /** + * The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * + * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + * + * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadChallengeOptions ' . $options . ']'; + } +} + +class UpdateChallengeOptions extends Options + { + /** + * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + */ + public function __construct( + + string $authPayload = Values::NONE, + array $metadata = Values::ARRAY_NONE + + ) { + $this->options['authPayload'] = $authPayload; + $this->options['metadata'] = $metadata; + } + + /** + * The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * + * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * + * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * @return $this Fluent Builder + */ + public function setMetadata(array $metadata): self + { + $this->options['metadata'] = $metadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateChallengeOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php new file mode 100644 index 0000000..1cc264c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChallengeInstance \Twilio\Rest\Verify\V2\Service\Entity\ChallengeInstance + */ + public function buildInstance(array $payload): ChallengeInstance + { + return new ChallengeInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ChallengePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php new file mode 100644 index 0000000..17eb009 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php @@ -0,0 +1,156 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FactorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the FactorInstance + * + * @return FactorInstance Fetched FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FactorInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new FactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Update the FactorInstance + * + * @param array|Options $options Optional Arguments + * @return FactorInstance Updated FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FactorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthPayload' => + $options['authPayload'], + 'FriendlyName' => + $options['friendlyName'], + 'Config.NotificationToken' => + $options['configNotificationToken'], + 'Config.SdkVersion' => + $options['configSdkVersion'], + 'Config.TimeStep' => + $options['configTimeStep'], + 'Config.Skew' => + $options['configSkew'], + 'Config.CodeLength' => + $options['configCodeLength'], + 'Config.Alg' => + $options['configAlg'], + 'Config.NotificationPlatform' => + $options['configNotificationPlatform'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new FactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FactorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php new file mode 100644 index 0000000..dfb5d06 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'config' => Values::array_get($payload, 'config'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 FactorContext Context for this FactorInstance + */ + protected function proxy(): FactorContext + { + if (!$this->context) { + $this->context = new FactorContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FactorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FactorInstance + * + * @return FactorInstance Fetched FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FactorInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FactorInstance + * + * @param array|Options $options Optional Arguments + * @return FactorInstance Updated FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FactorInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FactorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php new file mode 100644 index 0000000..a337644 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors'; + } + + /** + * Reads FactorInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FactorInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FactorInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FactorInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FactorPage Page of FactorInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FactorPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FactorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FactorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FactorPage Page of FactorInstance + */ + public function getPage(string $targetUrl): FactorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FactorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FactorContext + * + * @param string $sid A 34 character string that uniquely identifies this Factor. + */ + public function getContext( + string $sid + + ): FactorContext + { + return new FactorContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FactorList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php new file mode 100644 index 0000000..318924c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php @@ -0,0 +1,224 @@ +options['authPayload'] = $authPayload; + $this->options['friendlyName'] = $friendlyName; + $this->options['configNotificationToken'] = $configNotificationToken; + $this->options['configSdkVersion'] = $configSdkVersion; + $this->options['configTimeStep'] = $configTimeStep; + $this->options['configSkew'] = $configSkew; + $this->options['configCodeLength'] = $configCodeLength; + $this->options['configAlg'] = $configAlg; + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + } + + /** + * The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. + * + * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * The new friendly name of this Factor. It can be up to 64 characters. + * + * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. + * + * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. + * @return $this Fluent Builder + */ + public function setConfigNotificationToken(string $configNotificationToken): self + { + $this->options['configNotificationToken'] = $configNotificationToken; + return $this; + } + + /** + * The Verify Push SDK version used to configure the factor + * + * @param string $configSdkVersion The Verify Push SDK version used to configure the factor + * @return $this Fluent Builder + */ + public function setConfigSdkVersion(string $configSdkVersion): self + { + $this->options['configSdkVersion'] = $configSdkVersion; + return $this; + } + + /** + * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive + * + * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive + * @return $this Fluent Builder + */ + public function setConfigTimeStep(int $configTimeStep): self + { + $this->options['configTimeStep'] = $configTimeStep; + return $this; + } + + /** + * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive + * + * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive + * @return $this Fluent Builder + */ + public function setConfigSkew(int $configSkew): self + { + $this->options['configSkew'] = $configSkew; + return $this; + } + + /** + * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive + * + * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive + * @return $this Fluent Builder + */ + public function setConfigCodeLength(int $configCodeLength): self + { + $this->options['configCodeLength'] = $configCodeLength; + return $this; + } + + /** + * @param string $configAlg + * @return $this Fluent Builder + */ + public function setConfigAlg(string $configAlg): self + { + $this->options['configAlg'] = $configAlg; + return $this; + } + + /** + * The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. + * + * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigNotificationPlatform(string $configNotificationPlatform): self + { + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateFactorOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php new file mode 100644 index 0000000..d21ac66 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FactorInstance \Twilio\Rest\Verify\V2\Service\Entity\FactorInstance + */ + public function buildInstance(array $payload): FactorInstance + { + return new FactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FactorPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php new file mode 100644 index 0000000..3ef6cf9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php @@ -0,0 +1,109 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'binding' => Values::array_get($payload, 'binding'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'config' => Values::array_get($payload, 'config'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php new file mode 100644 index 0000000..5b99456 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php @@ -0,0 +1,124 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors'; + } + + /** + * Create the NewFactorInstance + * + * @param string $friendlyName The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. + * @param string $factorType + * @param array|Options $options Optional Arguments + * @return NewFactorInstance Created NewFactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $factorType, array $options = []): NewFactorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'FactorType' => + $factorType, + 'Binding.Alg' => + $options['bindingAlg'], + 'Binding.PublicKey' => + $options['bindingPublicKey'], + 'Config.AppId' => + $options['configAppId'], + 'Config.NotificationPlatform' => + $options['configNotificationPlatform'], + 'Config.NotificationToken' => + $options['configNotificationToken'], + 'Config.SdkVersion' => + $options['configSdkVersion'], + 'Binding.Secret' => + $options['bindingSecret'], + 'Config.TimeStep' => + $options['configTimeStep'], + 'Config.Skew' => + $options['configSkew'], + 'Config.CodeLength' => + $options['configCodeLength'], + 'Config.Alg' => + $options['configAlg'], + 'Metadata' => + Serialize::jsonObject($options['metadata']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new NewFactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php new file mode 100644 index 0000000..f71552b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php @@ -0,0 +1,270 @@ +options['bindingAlg'] = $bindingAlg; + $this->options['bindingPublicKey'] = $bindingPublicKey; + $this->options['configAppId'] = $configAppId; + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + $this->options['configNotificationToken'] = $configNotificationToken; + $this->options['configSdkVersion'] = $configSdkVersion; + $this->options['bindingSecret'] = $bindingSecret; + $this->options['configTimeStep'] = $configTimeStep; + $this->options['configSkew'] = $configSkew; + $this->options['configCodeLength'] = $configCodeLength; + $this->options['configAlg'] = $configAlg; + $this->options['metadata'] = $metadata; + } + + /** + * The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` + * + * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` + * @return $this Fluent Builder + */ + public function setBindingAlg(string $bindingAlg): self + { + $this->options['bindingAlg'] = $bindingAlg; + return $this; + } + + /** + * The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` + * + * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` + * @return $this Fluent Builder + */ + public function setBindingPublicKey(string $bindingPublicKey): self + { + $this->options['bindingPublicKey'] = $bindingPublicKey; + return $this; + } + + /** + * The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. + * + * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigAppId(string $configAppId): self + { + $this->options['configAppId'] = $configAppId; + return $this; + } + + /** + * @param string $configNotificationPlatform + * @return $this Fluent Builder + */ + public function setConfigNotificationPlatform(string $configNotificationPlatform): self + { + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + return $this; + } + + /** + * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. + * + * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigNotificationToken(string $configNotificationToken): self + { + $this->options['configNotificationToken'] = $configNotificationToken; + return $this; + } + + /** + * The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` + * + * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` + * @return $this Fluent Builder + */ + public function setConfigSdkVersion(string $configSdkVersion): self + { + $this->options['configSdkVersion'] = $configSdkVersion; + return $this; + } + + /** + * The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` + * + * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setBindingSecret(string $bindingSecret): self + { + $this->options['bindingSecret'] = $bindingSecret; + return $this; + } + + /** + * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` + * + * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigTimeStep(int $configTimeStep): self + { + $this->options['configTimeStep'] = $configTimeStep; + return $this; + } + + /** + * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` + * + * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigSkew(int $configSkew): self + { + $this->options['configSkew'] = $configSkew; + return $this; + } + + /** + * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` + * + * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigCodeLength(int $configCodeLength): self + { + $this->options['configCodeLength'] = $configCodeLength; + return $this; + } + + /** + * @param string $configAlg + * @return $this Fluent Builder + */ + public function setConfigAlg(string $configAlg): self + { + $this->options['configAlg'] = $configAlg; + return $this; + } + + /** + * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * + * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * @return $this Fluent Builder + */ + public function setMetadata(array $metadata): self + { + $this->options['metadata'] = $metadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateNewFactorOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php new file mode 100644 index 0000000..72e69f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewFactorInstance \Twilio\Rest\Verify\V2\Service\Entity\NewFactorInstance + */ + public function buildInstance(array $payload): NewFactorInstance + { + return new NewFactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityContext.php new file mode 100644 index 0000000..aee6b4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityContext.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the EntityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the EntityInstance + * + * @return EntityInstance Fetched EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EntityInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new EntityInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Access the factors + */ + protected function getFactors(): FactorList + { + if (!$this->_factors) { + $this->_factors = new FactorList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_factors; + } + + /** + * Access the newFactors + */ + protected function getNewFactors(): NewFactorList + { + if (!$this->_newFactors) { + $this->_newFactors = new NewFactorList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_newFactors; + } + + /** + * Access the challenges + */ + protected function getChallenges(): ChallengeList + { + if (!$this->_challenges) { + $this->_challenges = new ChallengeList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_challenges; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.EntityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityInstance.php new file mode 100644 index 0000000..04e105c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityInstance.php @@ -0,0 +1,175 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 EntityContext Context for this EntityInstance + */ + protected function proxy(): EntityContext + { + if (!$this->context) { + $this->context = new EntityContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the EntityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EntityInstance + * + * @return EntityInstance Fetched EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EntityInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the factors + */ + protected function getFactors(): FactorList + { + return $this->proxy()->factors; + } + + /** + * Access the newFactors + */ + protected function getNewFactors(): NewFactorList + { + return $this->proxy()->newFactors; + } + + /** + * Access the challenges + */ + protected function getChallenges(): ChallengeList + { + return $this->proxy()->challenges; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.EntityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityList.php new file mode 100644 index 0000000..172da96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityList.php @@ -0,0 +1,195 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities'; + } + + /** + * Create the EntityInstance + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + * @return EntityInstance Created EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity): EntityInstance + { + + $data = Values::of([ + 'Identity' => + $identity, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EntityInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads EntityInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EntityInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EntityInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EntityInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EntityPage Page of EntityInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EntityPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EntityPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EntityInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EntityPage Page of EntityInstance + */ + public function getPage(string $targetUrl): EntityPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EntityPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EntityContext + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + public function getContext( + string $identity + + ): EntityContext + { + return new EntityContext( + $this->version, + $this->solution['serviceSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.EntityList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityPage.php new file mode 100644 index 0000000..9a72fc7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/EntityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EntityInstance \Twilio\Rest\Verify\V2\Service\EntityInstance + */ + public function buildInstance(array $payload): EntityInstance + { + return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.EntityPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php new file mode 100644 index 0000000..ffa20d1 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php @@ -0,0 +1,130 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'country' => + $country, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/MessagingConfigurations/' . \rawurlencode($country) + .''; + } + + /** + * Delete the MessagingConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessagingConfigurationInstance + * + * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessagingConfigurationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + + /** + * Update the MessagingConfigurationInstance + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $messagingServiceSid): MessagingConfigurationInstance + { + + $data = Values::of([ + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.MessagingConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php new file mode 100644 index 0000000..7d65ca6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php @@ -0,0 +1,155 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'country' => Values::array_get($payload, 'country'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'country' => $country ?: $this->properties['country'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessagingConfigurationContext Context for this MessagingConfigurationInstance + */ + protected function proxy(): MessagingConfigurationContext + { + if (!$this->context) { + $this->context = new MessagingConfigurationContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + return $this->context; + } + + /** + * Delete the MessagingConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessagingConfigurationInstance + * + * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessagingConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessagingConfigurationInstance + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $messagingServiceSid): MessagingConfigurationInstance + { + + return $this->proxy()->update($messagingServiceSid); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.MessagingConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php new file mode 100644 index 0000000..08631a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php @@ -0,0 +1,198 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/MessagingConfigurations'; + } + + /** + * Create the MessagingConfigurationInstance + * + * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Created MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $country, string $messagingServiceSid): MessagingConfigurationInstance + { + + $data = Values::of([ + 'Country' => + $country, + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads MessagingConfigurationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessagingConfigurationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams MessagingConfigurationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessagingConfigurationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagingConfigurationPage Page of MessagingConfigurationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagingConfigurationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagingConfigurationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessagingConfigurationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagingConfigurationPage Page of MessagingConfigurationInstance + */ + public function getPage(string $targetUrl): MessagingConfigurationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagingConfigurationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessagingConfigurationContext + * + * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. + */ + public function getContext( + string $country + + ): MessagingConfigurationContext + { + return new MessagingConfigurationContext( + $this->version, + $this->solution['serviceSid'], + $country + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.MessagingConfigurationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php new file mode 100644 index 0000000..9e3016e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessagingConfigurationInstance \Twilio\Rest\Verify\V2\Service\MessagingConfigurationInstance + */ + public function buildInstance(array $payload): MessagingConfigurationInstance + { + return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.MessagingConfigurationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php new file mode 100644 index 0000000..20d5793 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'rateLimitSid' => + $rateLimitSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($rateLimitSid) + .'/Buckets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BucketInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the BucketInstance + * + * @return BucketInstance Fetched BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BucketInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the BucketInstance + * + * @param array|Options $options Optional Arguments + * @return BucketInstance Updated BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BucketInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Max' => + $options['max'], + 'Interval' => + $options['interval'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php new file mode 100644 index 0000000..d5cbe43 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'rateLimitSid' => Values::array_get($payload, 'rate_limit_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'max' => Values::array_get($payload, 'max'), + 'interval' => Values::array_get($payload, 'interval'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BucketContext Context for this BucketInstance + */ + protected function proxy(): BucketContext + { + if (!$this->context) { + $this->context = new BucketContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BucketInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BucketInstance + * + * @return BucketInstance Fetched BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BucketInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BucketInstance + * + * @param array|Options $options Optional Arguments + * @return BucketInstance Updated BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BucketInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.BucketInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php new file mode 100644 index 0000000..d3ad5c7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php @@ -0,0 +1,206 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'rateLimitSid' => + $rateLimitSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($rateLimitSid) + .'/Buckets'; + } + + /** + * Create the BucketInstance + * + * @param int $max Maximum number of requests permitted in during the interval. + * @param int $interval Number of seconds that the rate limit will be enforced over. + * @return BucketInstance Created BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(int $max, int $interval): BucketInstance + { + + $data = Values::of([ + 'Max' => + $max, + 'Interval' => + $interval, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'] + ); + } + + + /** + * Reads BucketInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BucketInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BucketInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BucketInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BucketPage Page of BucketInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BucketPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BucketPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BucketInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BucketPage Page of BucketInstance + */ + public function getPage(string $targetUrl): BucketPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BucketPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BucketContext + * + * @param string $sid A 34 character string that uniquely identifies this Bucket. + */ + public function getContext( + string $sid + + ): BucketContext + { + return new BucketContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.BucketList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php new file mode 100644 index 0000000..a49698e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php @@ -0,0 +1,102 @@ +options['max'] = $max; + $this->options['interval'] = $interval; + } + + /** + * Maximum number of requests permitted in during the interval. + * + * @param int $max Maximum number of requests permitted in during the interval. + * @return $this Fluent Builder + */ + public function setMax(int $max): self + { + $this->options['max'] = $max; + return $this; + } + + /** + * Number of seconds that the rate limit will be enforced over. + * + * @param int $interval Number of seconds that the rate limit will be enforced over. + * @return $this Fluent Builder + */ + public function setInterval(int $interval): self + { + $this->options['interval'] = $interval; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateBucketOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php new file mode 100644 index 0000000..3409e37 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BucketInstance \Twilio\Rest\Verify\V2\Service\RateLimit\BucketInstance + */ + public function buildInstance(array $payload): BucketInstance + { + return new BucketInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.BucketPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php new file mode 100644 index 0000000..42d7ff7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php @@ -0,0 +1,192 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RateLimitInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RateLimitInstance + * + * @return RateLimitInstance Fetched RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RateLimitInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RateLimitInstance + * + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Updated RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RateLimitInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the buckets + */ + protected function getBuckets(): BucketList + { + if (!$this->_buckets) { + $this->_buckets = new BucketList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_buckets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.RateLimitContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php new file mode 100644 index 0000000..890f4de --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'description' => Values::array_get($payload, 'description'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 RateLimitContext Context for this RateLimitInstance + */ + protected function proxy(): RateLimitContext + { + if (!$this->context) { + $this->context = new RateLimitContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RateLimitInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RateLimitInstance + * + * @return RateLimitInstance Fetched RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RateLimitInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RateLimitInstance + * + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Updated RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RateLimitInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the buckets + */ + protected function getBuckets(): BucketList + { + return $this->proxy()->buckets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.RateLimitInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php new file mode 100644 index 0000000..6c52c16 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits'; + } + + /** + * Create the RateLimitInstance + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Created RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): RateLimitInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RateLimitInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RateLimitInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RateLimitInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RateLimitInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RateLimitPage Page of RateLimitInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RateLimitPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RateLimitPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RateLimitInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RateLimitPage Page of RateLimitInstance + */ + public function getPage(string $targetUrl): RateLimitPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RateLimitPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RateLimitContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. + */ + public function getContext( + string $sid + + ): RateLimitContext + { + return new RateLimitContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.RateLimitList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php new file mode 100644 index 0000000..be0f4f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php @@ -0,0 +1,134 @@ +options['description'] = $description; + } + + /** + * Description of this Rate Limit + * + * @param string $description Description of this Rate Limit + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateRateLimitOptions ' . $options . ']'; + } +} + + + + +class UpdateRateLimitOptions extends Options + { + /** + * @param string $description Description of this Rate Limit + */ + public function __construct( + + string $description = Values::NONE + + ) { + $this->options['description'] = $description; + } + + /** + * Description of this Rate Limit + * + * @param string $description Description of this Rate Limit + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateRateLimitOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php new file mode 100644 index 0000000..c0095f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RateLimitInstance \Twilio\Rest\Verify\V2\Service\RateLimitInstance + */ + public function buildInstance(array $payload): RateLimitInstance + { + return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.RateLimitPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php new file mode 100644 index 0000000..b562531 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php @@ -0,0 +1,104 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channel' => Values::array_get($payload, 'channel'), + 'status' => Values::array_get($payload, 'status'), + 'valid' => Values::array_get($payload, 'valid'), + 'amount' => Values::array_get($payload, 'amount'), + 'payee' => Values::array_get($payload, 'payee'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'snaAttemptsErrorCodes' => Values::array_get($payload, 'sna_attempts_error_codes'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php new file mode 100644 index 0000000..39e44cc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php @@ -0,0 +1,96 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/VerificationCheck'; + } + + /** + * Create the VerificationCheckInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationCheckInstance Created VerificationCheckInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): VerificationCheckInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Code' => + $options['code'], + 'To' => + $options['to'], + 'VerificationSid' => + $options['verificationSid'], + 'Amount' => + $options['amount'], + 'Payee' => + $options['payee'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new VerificationCheckInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php new file mode 100644 index 0000000..4400534 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php @@ -0,0 +1,148 @@ +options['code'] = $code; + $this->options['to'] = $to; + $this->options['verificationSid'] = $verificationSid; + $this->options['amount'] = $amount; + $this->options['payee'] = $payee; + } + + /** + * The 4-10 character string being verified. + * + * @param string $code The 4-10 character string being verified. + * @return $this Fluent Builder + */ + public function setCode(string $code): self + { + $this->options['code'] = $code; + return $this; + } + + /** + * The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * + * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. + * + * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. + * @return $this Fluent Builder + */ + public function setVerificationSid(string $verificationSid): self + { + $this->options['verificationSid'] = $verificationSid; + return $this; + } + + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setAmount(string $amount): self + { + $this->options['amount'] = $amount; + return $this; + } + + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setPayee(string $payee): self + { + $this->options['payee'] = $payee; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateVerificationCheckOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php new file mode 100644 index 0000000..5060e3d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationCheckInstance \Twilio\Rest\Verify\V2\Service\VerificationCheckInstance + */ + public function buildInstance(array $payload): VerificationCheckInstance + { + return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php new file mode 100644 index 0000000..8c449a2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php @@ -0,0 +1,116 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Verifications/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the VerificationInstance + * + * @return VerificationInstance Fetched VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the VerificationInstance + * + * @param string $status + * @return VerificationInstance Updated VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): VerificationInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php new file mode 100644 index 0000000..0fd1c9b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channel' => Values::array_get($payload, 'channel'), + 'status' => Values::array_get($payload, 'status'), + 'valid' => Values::array_get($payload, 'valid'), + 'lookup' => Values::array_get($payload, 'lookup'), + 'amount' => Values::array_get($payload, 'amount'), + 'payee' => Values::array_get($payload, 'payee'), + 'sendCodeAttempts' => Values::array_get($payload, 'send_code_attempts'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sna' => Values::array_get($payload, 'sna'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 VerificationContext Context for this VerificationInstance + */ + protected function proxy(): VerificationContext + { + if (!$this->context) { + $this->context = new VerificationContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationInstance + * + * @return VerificationInstance Fetched VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the VerificationInstance + * + * @param string $status + * @return VerificationInstance Updated VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): VerificationInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php new file mode 100644 index 0000000..8daafe2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php @@ -0,0 +1,140 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Verifications'; + } + + /** + * Create the VerificationInstance + * + * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @param string $channel The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`. + * @param array|Options $options Optional Arguments + * @return VerificationInstance Created VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $channel, array $options = []): VerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'Channel' => + $channel, + 'CustomFriendlyName' => + $options['customFriendlyName'], + 'CustomMessage' => + $options['customMessage'], + 'SendDigits' => + $options['sendDigits'], + 'Locale' => + $options['locale'], + 'CustomCode' => + $options['customCode'], + 'Amount' => + $options['amount'], + 'Payee' => + $options['payee'], + 'RateLimits' => + Serialize::jsonObject($options['rateLimits']), + 'ChannelConfiguration' => + Serialize::jsonObject($options['channelConfiguration']), + 'AppHash' => + $options['appHash'], + 'TemplateSid' => + $options['templateSid'], + 'TemplateCustomSubstitutions' => + $options['templateCustomSubstitutions'], + 'DeviceIp' => + $options['deviceIp'], + 'RiskCheck' => + $options['riskCheck'], + 'Tags' => + $options['tags'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Constructs a VerificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. + */ + public function getContext( + string $sid + + ): VerificationContext + { + return new VerificationContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php new file mode 100644 index 0000000..dcaf306 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php @@ -0,0 +1,330 @@ + Your AppName verification code is: 1234 He42w354ol9`. + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * @param string $riskCheck + * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. + * @return CreateVerificationOptions Options builder + */ + public static function create( + + string $customFriendlyName = Values::NONE, + string $customMessage = Values::NONE, + string $sendDigits = Values::NONE, + string $locale = Values::NONE, + string $customCode = Values::NONE, + string $amount = Values::NONE, + string $payee = Values::NONE, + array $rateLimits = Values::ARRAY_NONE, + array $channelConfiguration = Values::ARRAY_NONE, + string $appHash = Values::NONE, + string $templateSid = Values::NONE, + string $templateCustomSubstitutions = Values::NONE, + string $deviceIp = Values::NONE, + string $riskCheck = Values::NONE, + string $tags = Values::NONE + + ): CreateVerificationOptions + { + return new CreateVerificationOptions( + $customFriendlyName, + $customMessage, + $sendDigits, + $locale, + $customCode, + $amount, + $payee, + $rateLimits, + $channelConfiguration, + $appHash, + $templateSid, + $templateCustomSubstitutions, + $deviceIp, + $riskCheck, + $tags + ); + } + + + +} + +class CreateVerificationOptions extends Options + { + /** + * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message + * @param string $customMessage The text of a custom message to use for the verification. + * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * @param string $riskCheck + * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. + */ + public function __construct( + + string $customFriendlyName = Values::NONE, + string $customMessage = Values::NONE, + string $sendDigits = Values::NONE, + string $locale = Values::NONE, + string $customCode = Values::NONE, + string $amount = Values::NONE, + string $payee = Values::NONE, + array $rateLimits = Values::ARRAY_NONE, + array $channelConfiguration = Values::ARRAY_NONE, + string $appHash = Values::NONE, + string $templateSid = Values::NONE, + string $templateCustomSubstitutions = Values::NONE, + string $deviceIp = Values::NONE, + string $riskCheck = Values::NONE, + string $tags = Values::NONE + + ) { + $this->options['customFriendlyName'] = $customFriendlyName; + $this->options['customMessage'] = $customMessage; + $this->options['sendDigits'] = $sendDigits; + $this->options['locale'] = $locale; + $this->options['customCode'] = $customCode; + $this->options['amount'] = $amount; + $this->options['payee'] = $payee; + $this->options['rateLimits'] = $rateLimits; + $this->options['channelConfiguration'] = $channelConfiguration; + $this->options['appHash'] = $appHash; + $this->options['templateSid'] = $templateSid; + $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; + $this->options['deviceIp'] = $deviceIp; + $this->options['riskCheck'] = $riskCheck; + $this->options['tags'] = $tags; + } + + /** + * A custom user defined friendly name that overwrites the existing one in the verification message + * + * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message + * @return $this Fluent Builder + */ + public function setCustomFriendlyName(string $customFriendlyName): self + { + $this->options['customFriendlyName'] = $customFriendlyName; + return $this; + } + + /** + * The text of a custom message to use for the verification. + * + * @param string $customMessage The text of a custom message to use for the verification. + * @return $this Fluent Builder + */ + public function setCustomMessage(string $customMessage): self + { + $this->options['customMessage'] = $customMessage; + return $this; + } + + /** + * The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * + * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * @return $this Fluent Builder + */ + public function setSendDigits(string $sendDigits): self + { + $this->options['sendDigits'] = $sendDigits; + return $this; + } + + /** + * Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * + * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * @return $this Fluent Builder + */ + public function setLocale(string $locale): self + { + $this->options['locale'] = $locale; + return $this; + } + + /** + * A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * + * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * @return $this Fluent Builder + */ + public function setCustomCode(string $customCode): self + { + $this->options['customCode'] = $customCode; + return $this; + } + + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setAmount(string $amount): self + { + $this->options['amount'] = $amount; + return $this; + } + + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setPayee(string $payee): self + { + $this->options['payee'] = $payee; + return $this; + } + + /** + * The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * + * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * @return $this Fluent Builder + */ + public function setRateLimits(array $rateLimits): self + { + $this->options['rateLimits'] = $rateLimits; + return $this; + } + + /** + * [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * + * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * @return $this Fluent Builder + */ + public function setChannelConfiguration(array $channelConfiguration): self + { + $this->options['channelConfiguration'] = $channelConfiguration; + return $this; + } + + /** + * Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * + * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * @return $this Fluent Builder + */ + public function setAppHash(string $appHash): self + { + $this->options['appHash'] = $appHash; + return $this; + } + + /** + * The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @return $this Fluent Builder + */ + public function setTemplateSid(string $templateSid): self + { + $this->options['templateSid'] = $templateSid; + return $this; + } + + /** + * A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @return $this Fluent Builder + */ + public function setTemplateCustomSubstitutions(string $templateCustomSubstitutions): self + { + $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; + return $this; + } + + /** + * Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * @return $this Fluent Builder + */ + public function setDeviceIp(string $deviceIp): self + { + $this->options['deviceIp'] = $deviceIp; + return $this; + } + + /** + * @param string $riskCheck + * @return $this Fluent Builder + */ + public function setRiskCheck(string $riskCheck): self + { + $this->options['riskCheck'] = $riskCheck; + return $this; + } + + /** + * A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. + * + * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. + * @return $this Fluent Builder + */ + public function setTags(string $tags): self + { + $this->options['tags'] = $tags; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateVerificationOptions ' . $options . ']'; + } +} + + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php new file mode 100644 index 0000000..515e91f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationInstance \Twilio\Rest\Verify\V2\Service\VerificationInstance + */ + public function buildInstance(array $payload): VerificationInstance + { + return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php new file mode 100644 index 0000000..3e6e2e0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'EventTypes' => + Serialize::map($options['eventTypes'], function ($e) { return $e; }), + 'WebhookUrl' => + $options['webhookUrl'], + 'Status' => + $options['status'], + 'Version' => + $options['version'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookInstance.php new file mode 100644 index 0000000..2bc0958 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'eventTypes' => Values::array_get($payload, 'event_types'), + 'status' => Values::array_get($payload, 'status'), + 'version' => Values::array_get($payload, 'version'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + '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 = ['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 WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookList.php new file mode 100644 index 0000000..119afdd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookList.php @@ -0,0 +1,210 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @param string $webhookUrl The URL associated with this Webhook. + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $eventTypes, string $webhookUrl, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'EventTypes' => + Serialize::map($eventTypes,function ($e) { return $e; }), + 'WebhookUrl' => + $webhookUrl, + 'Status' => + $options['status'], + 'Version' => + $options['version'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.WebhookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookOptions.php new file mode 100644 index 0000000..79993b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookOptions.php @@ -0,0 +1,216 @@ +options['status'] = $status; + $this->options['version'] = $version; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * @param string $version + * @return $this Fluent Builder + */ + public function setVersion(string $version): self + { + $this->options['version'] = $version; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @param string $webhookUrl The URL associated with this Webhook. + * @param string $status + * @param string $version + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $eventTypes = Values::ARRAY_NONE, + string $webhookUrl = Values::NONE, + string $status = Values::NONE, + string $version = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['eventTypes'] = $eventTypes; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['status'] = $status; + $this->options['version'] = $version; + } + + /** + * The string that you assigned to describe the webhook. **This value should not contain PII.** + * + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @return $this Fluent Builder + */ + public function setEventTypes(array $eventTypes): self + { + $this->options['eventTypes'] = $eventTypes; + return $this; + } + + /** + * The URL associated with this Webhook. + * + * @param string $webhookUrl The URL associated with this Webhook. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * @param string $version + * @return $this Fluent Builder + */ + public function setVersion(string $version): self + { + $this->options['version'] = $version; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookPage.php new file mode 100644 index 0000000..5dee3f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/Service/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Verify\V2\Service\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.WebhookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php new file mode 100644 index 0000000..35dfb5f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php @@ -0,0 +1,336 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'CodeLength' => + $options['codeLength'], + 'LookupEnabled' => + Serialize::booleanToString($options['lookupEnabled']), + 'SkipSmsToLandlines' => + Serialize::booleanToString($options['skipSmsToLandlines']), + 'DtmfInputRequired' => + Serialize::booleanToString($options['dtmfInputRequired']), + 'TtsName' => + $options['ttsName'], + 'Psd2Enabled' => + Serialize::booleanToString($options['psd2Enabled']), + 'DoNotShareWarningEnabled' => + Serialize::booleanToString($options['doNotShareWarningEnabled']), + 'CustomCodeEnabled' => + Serialize::booleanToString($options['customCodeEnabled']), + 'Push.IncludeDate' => + Serialize::booleanToString($options['pushIncludeDate']), + 'Push.ApnCredentialSid' => + $options['pushApnCredentialSid'], + 'Push.FcmCredentialSid' => + $options['pushFcmCredentialSid'], + 'Totp.Issuer' => + $options['totpIssuer'], + 'Totp.TimeStep' => + $options['totpTimeStep'], + 'Totp.CodeLength' => + $options['totpCodeLength'], + 'Totp.Skew' => + $options['totpSkew'], + 'DefaultTemplateSid' => + $options['defaultTemplateSid'], + 'Whatsapp.MsgServiceSid' => + $options['whatsappMsgServiceSid'], + 'Whatsapp.From' => + $options['whatsappFrom'], + 'VerifyEventSubscriptionEnabled' => + Serialize::booleanToString($options['verifyEventSubscriptionEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the entities + */ + protected function getEntities(): EntityList + { + if (!$this->_entities) { + $this->_entities = new EntityList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_entities; + } + + /** + * Access the verificationChecks + */ + protected function getVerificationChecks(): VerificationCheckList + { + if (!$this->_verificationChecks) { + $this->_verificationChecks = new VerificationCheckList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_verificationChecks; + } + + /** + * Access the verifications + */ + protected function getVerifications(): VerificationList + { + if (!$this->_verifications) { + $this->_verifications = new VerificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_verifications; + } + + /** + * Access the accessTokens + */ + protected function getAccessTokens(): AccessTokenList + { + if (!$this->_accessTokens) { + $this->_accessTokens = new AccessTokenList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_accessTokens; + } + + /** + * Access the rateLimits + */ + protected function getRateLimits(): RateLimitList + { + if (!$this->_rateLimits) { + $this->_rateLimits = new RateLimitList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_rateLimits; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messagingConfigurations + */ + protected function getMessagingConfigurations(): MessagingConfigurationList + { + if (!$this->_messagingConfigurations) { + $this->_messagingConfigurations = new MessagingConfigurationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messagingConfigurations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php new file mode 100644 index 0000000..f5eb4f6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php @@ -0,0 +1,251 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'codeLength' => Values::array_get($payload, 'code_length'), + 'lookupEnabled' => Values::array_get($payload, 'lookup_enabled'), + 'psd2Enabled' => Values::array_get($payload, 'psd2_enabled'), + 'skipSmsToLandlines' => Values::array_get($payload, 'skip_sms_to_landlines'), + 'dtmfInputRequired' => Values::array_get($payload, 'dtmf_input_required'), + 'ttsName' => Values::array_get($payload, 'tts_name'), + 'doNotShareWarningEnabled' => Values::array_get($payload, 'do_not_share_warning_enabled'), + 'customCodeEnabled' => Values::array_get($payload, 'custom_code_enabled'), + 'push' => Values::array_get($payload, 'push'), + 'totp' => Values::array_get($payload, 'totp'), + 'defaultTemplateSid' => Values::array_get($payload, 'default_template_sid'), + 'whatsapp' => Values::array_get($payload, 'whatsapp'), + 'verifyEventSubscriptionEnabled' => Values::array_get($payload, 'verify_event_subscription_enabled'), + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the entities + */ + protected function getEntities(): EntityList + { + return $this->proxy()->entities; + } + + /** + * Access the verificationChecks + */ + protected function getVerificationChecks(): VerificationCheckList + { + return $this->proxy()->verificationChecks; + } + + /** + * Access the verifications + */ + protected function getVerifications(): VerificationList + { + return $this->proxy()->verifications; + } + + /** + * Access the accessTokens + */ + protected function getAccessTokens(): AccessTokenList + { + return $this->proxy()->accessTokens; + } + + /** + * Access the rateLimits + */ + protected function getRateLimits(): RateLimitList + { + return $this->proxy()->rateLimits; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messagingConfigurations + */ + protected function getMessagingConfigurations(): MessagingConfigurationList + { + return $this->proxy()->messagingConfigurations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceList.php new file mode 100644 index 0000000..293da33 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceList.php @@ -0,0 +1,230 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'CodeLength' => + $options['codeLength'], + 'LookupEnabled' => + Serialize::booleanToString($options['lookupEnabled']), + 'SkipSmsToLandlines' => + Serialize::booleanToString($options['skipSmsToLandlines']), + 'DtmfInputRequired' => + Serialize::booleanToString($options['dtmfInputRequired']), + 'TtsName' => + $options['ttsName'], + 'Psd2Enabled' => + Serialize::booleanToString($options['psd2Enabled']), + 'DoNotShareWarningEnabled' => + Serialize::booleanToString($options['doNotShareWarningEnabled']), + 'CustomCodeEnabled' => + Serialize::booleanToString($options['customCodeEnabled']), + 'Push.IncludeDate' => + Serialize::booleanToString($options['pushIncludeDate']), + 'Push.ApnCredentialSid' => + $options['pushApnCredentialSid'], + 'Push.FcmCredentialSid' => + $options['pushFcmCredentialSid'], + 'Totp.Issuer' => + $options['totpIssuer'], + 'Totp.TimeStep' => + $options['totpTimeStep'], + 'Totp.CodeLength' => + $options['totpCodeLength'], + 'Totp.Skew' => + $options['totpSkew'], + 'DefaultTemplateSid' => + $options['defaultTemplateSid'], + 'Whatsapp.MsgServiceSid' => + $options['whatsappMsgServiceSid'], + 'Whatsapp.From' => + $options['whatsappFrom'], + 'VerifyEventSubscriptionEnabled' => + Serialize::booleanToString($options['verifyEventSubscriptionEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + '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 ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ServiceList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php new file mode 100644 index 0000000..3912af7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php @@ -0,0 +1,800 @@ +options['codeLength'] = $codeLength; + $this->options['lookupEnabled'] = $lookupEnabled; + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + $this->options['ttsName'] = $ttsName; + $this->options['psd2Enabled'] = $psd2Enabled; + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + $this->options['customCodeEnabled'] = $customCodeEnabled; + $this->options['pushIncludeDate'] = $pushIncludeDate; + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + $this->options['totpIssuer'] = $totpIssuer; + $this->options['totpTimeStep'] = $totpTimeStep; + $this->options['totpCodeLength'] = $totpCodeLength; + $this->options['totpSkew'] = $totpSkew; + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + $this->options['whatsappMsgServiceSid'] = $whatsappMsgServiceSid; + $this->options['whatsappFrom'] = $whatsappFrom; + $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; + } + + /** + * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @return $this Fluent Builder + */ + public function setCodeLength(int $codeLength): self + { + $this->options['codeLength'] = $codeLength; + return $this; + } + + /** + * Whether to perform a lookup with each verification started and return info about the phone number. + * + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @return $this Fluent Builder + */ + public function setLookupEnabled(bool $lookupEnabled): self + { + $this->options['lookupEnabled'] = $lookupEnabled; + return $this; + } + + /** + * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @return $this Fluent Builder + */ + public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self + { + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + return $this; + } + + /** + * Whether to ask the user to press a number before delivering the verify code in a phone call. + * + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @return $this Fluent Builder + */ + public function setDtmfInputRequired(bool $dtmfInputRequired): self + { + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + return $this; + } + + /** + * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @return $this Fluent Builder + */ + public function setTtsName(string $ttsName): self + { + $this->options['ttsName'] = $ttsName; + return $this; + } + + /** + * Whether to pass PSD2 transaction parameters when starting a verification. + * + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @return $this Fluent Builder + */ + public function setPsd2Enabled(bool $psd2Enabled): self + { + $this->options['psd2Enabled'] = $psd2Enabled; + return $this; + } + + /** + * Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` + * + * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` + * @return $this Fluent Builder + */ + public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self + { + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + return $this; + } + + /** + * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @return $this Fluent Builder + */ + public function setCustomCodeEnabled(bool $customCodeEnabled): self + { + $this->options['customCodeEnabled'] = $customCodeEnabled; + return $this; + } + + /** + * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. + * + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. + * @return $this Fluent Builder + */ + public function setPushIncludeDate(bool $pushIncludeDate): self + { + $this->options['pushIncludeDate'] = $pushIncludeDate; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushApnCredentialSid(string $pushApnCredentialSid): self + { + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self + { + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. + * + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. + * @return $this Fluent Builder + */ + public function setTotpIssuer(string $totpIssuer): self + { + $this->options['totpIssuer'] = $totpIssuer; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @return $this Fluent Builder + */ + public function setTotpTimeStep(int $totpTimeStep): self + { + $this->options['totpTimeStep'] = $totpTimeStep; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @return $this Fluent Builder + */ + public function setTotpCodeLength(int $totpCodeLength): self + { + $this->options['totpCodeLength'] = $totpCodeLength; + return $this; + } + + /** + * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @return $this Fluent Builder + */ + public function setTotpSkew(int $totpSkew): self + { + $this->options['totpSkew'] = $totpSkew; + return $this; + } + + /** + * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * @return $this Fluent Builder + */ + public function setDefaultTemplateSid(string $defaultTemplateSid): self + { + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + return $this; + } + + /** + * The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users. + * + * @param string $whatsappMsgServiceSid The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users. + * @return $this Fluent Builder + */ + public function setWhatsappMsgServiceSid(string $whatsappMsgServiceSid): self + { + $this->options['whatsappMsgServiceSid'] = $whatsappMsgServiceSid; + return $this; + } + + /** + * The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID. + * + * @param string $whatsappFrom The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID. + * @return $this Fluent Builder + */ + public function setWhatsappFrom(string $whatsappFrom): self + { + $this->options['whatsappFrom'] = $whatsappFrom; + return $this; + } + + /** + * Whether to allow verifications from the service to reach the stream-events sinks if configured + * + * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured + * @return $this Fluent Builder + */ + public function setVerifyEventSubscriptionEnabled(bool $verifyEventSubscriptionEnabled): self + { + $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * @param string $whatsappMsgServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + * @param string $whatsappFrom The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. + * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured + */ + public function __construct( + + string $friendlyName = Values::NONE, + int $codeLength = Values::INT_NONE, + bool $lookupEnabled = Values::BOOL_NONE, + bool $skipSmsToLandlines = Values::BOOL_NONE, + bool $dtmfInputRequired = Values::BOOL_NONE, + string $ttsName = Values::NONE, + bool $psd2Enabled = Values::BOOL_NONE, + bool $doNotShareWarningEnabled = Values::BOOL_NONE, + bool $customCodeEnabled = Values::BOOL_NONE, + bool $pushIncludeDate = Values::BOOL_NONE, + string $pushApnCredentialSid = Values::NONE, + string $pushFcmCredentialSid = Values::NONE, + string $totpIssuer = Values::NONE, + int $totpTimeStep = Values::INT_NONE, + int $totpCodeLength = Values::INT_NONE, + int $totpSkew = Values::INT_NONE, + string $defaultTemplateSid = Values::NONE, + string $whatsappMsgServiceSid = Values::NONE, + string $whatsappFrom = Values::NONE, + bool $verifyEventSubscriptionEnabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['codeLength'] = $codeLength; + $this->options['lookupEnabled'] = $lookupEnabled; + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + $this->options['ttsName'] = $ttsName; + $this->options['psd2Enabled'] = $psd2Enabled; + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + $this->options['customCodeEnabled'] = $customCodeEnabled; + $this->options['pushIncludeDate'] = $pushIncludeDate; + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + $this->options['totpIssuer'] = $totpIssuer; + $this->options['totpTimeStep'] = $totpTimeStep; + $this->options['totpCodeLength'] = $totpCodeLength; + $this->options['totpSkew'] = $totpSkew; + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + $this->options['whatsappMsgServiceSid'] = $whatsappMsgServiceSid; + $this->options['whatsappFrom'] = $whatsappFrom; + $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; + } + + /** + * A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + * + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @return $this Fluent Builder + */ + public function setCodeLength(int $codeLength): self + { + $this->options['codeLength'] = $codeLength; + return $this; + } + + /** + * Whether to perform a lookup with each verification started and return info about the phone number. + * + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @return $this Fluent Builder + */ + public function setLookupEnabled(bool $lookupEnabled): self + { + $this->options['lookupEnabled'] = $lookupEnabled; + return $this; + } + + /** + * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @return $this Fluent Builder + */ + public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self + { + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + return $this; + } + + /** + * Whether to ask the user to press a number before delivering the verify code in a phone call. + * + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @return $this Fluent Builder + */ + public function setDtmfInputRequired(bool $dtmfInputRequired): self + { + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + return $this; + } + + /** + * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @return $this Fluent Builder + */ + public function setTtsName(string $ttsName): self + { + $this->options['ttsName'] = $ttsName; + return $this; + } + + /** + * Whether to pass PSD2 transaction parameters when starting a verification. + * + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @return $this Fluent Builder + */ + public function setPsd2Enabled(bool $psd2Enabled): self + { + $this->options['psd2Enabled'] = $psd2Enabled; + return $this; + } + + /** + * Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * + * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * @return $this Fluent Builder + */ + public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self + { + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + return $this; + } + + /** + * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @return $this Fluent Builder + */ + public function setCustomCodeEnabled(bool $customCodeEnabled): self + { + $this->options['customCodeEnabled'] = $customCodeEnabled; + return $this; + } + + /** + * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * @return $this Fluent Builder + */ + public function setPushIncludeDate(bool $pushIncludeDate): self + { + $this->options['pushIncludeDate'] = $pushIncludeDate; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushApnCredentialSid(string $pushApnCredentialSid): self + { + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self + { + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * @return $this Fluent Builder + */ + public function setTotpIssuer(string $totpIssuer): self + { + $this->options['totpIssuer'] = $totpIssuer; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @return $this Fluent Builder + */ + public function setTotpTimeStep(int $totpTimeStep): self + { + $this->options['totpTimeStep'] = $totpTimeStep; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @return $this Fluent Builder + */ + public function setTotpCodeLength(int $totpCodeLength): self + { + $this->options['totpCodeLength'] = $totpCodeLength; + return $this; + } + + /** + * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @return $this Fluent Builder + */ + public function setTotpSkew(int $totpSkew): self + { + $this->options['totpSkew'] = $totpSkew; + return $this; + } + + /** + * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * @return $this Fluent Builder + */ + public function setDefaultTemplateSid(string $defaultTemplateSid): self + { + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + * + * @param string $whatsappMsgServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + * @return $this Fluent Builder + */ + public function setWhatsappMsgServiceSid(string $whatsappMsgServiceSid): self + { + $this->options['whatsappMsgServiceSid'] = $whatsappMsgServiceSid; + return $this; + } + + /** + * The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. + * + * @param string $whatsappFrom The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. + * @return $this Fluent Builder + */ + public function setWhatsappFrom(string $whatsappFrom): self + { + $this->options['whatsappFrom'] = $whatsappFrom; + return $this; + } + + /** + * Whether to allow verifications from the service to reach the stream-events sinks if configured + * + * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured + * @return $this Fluent Builder + */ + public function setVerifyEventSubscriptionEnabled(bool $verifyEventSubscriptionEnabled): self + { + $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServicePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServicePage.php new file mode 100644 index 0000000..c5754ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Verify\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ServicePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateInstance.php new file mode 100644 index 0000000..ccceadd --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'channels' => Values::array_get($payload, 'channels'), + 'translations' => Values::array_get($payload, 'translations'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateList.php new file mode 100644 index 0000000..c4f578b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateList.php @@ -0,0 +1,152 @@ +solution = [ + ]; + + $this->uri = '/Templates'; + } + + /** + * Reads TemplateInstance 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 TemplateInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TemplateInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TemplateInstance 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 TemplatePage Page of TemplateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TemplatePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TemplatePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TemplateInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TemplatePage Page of TemplateInstance + */ + public function getPage(string $targetUrl): TemplatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TemplatePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateOptions.php new file mode 100644 index 0000000..c60d9cb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplateOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * String filter used to query templates with a given friendly name. + * + * @param string $friendlyName String filter used to query templates with a given friendly name. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadTemplateOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplatePage.php new file mode 100644 index 0000000..96be986 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/TemplatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TemplateInstance \Twilio\Rest\Verify\V2\TemplateInstance + */ + public function buildInstance(array $payload): TemplateInstance + { + return new TemplateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php new file mode 100644 index 0000000..751f7f2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php @@ -0,0 +1,83 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Attempts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the VerificationAttemptInstance + * + * @return VerificationAttemptInstance Fetched VerificationAttemptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationAttemptInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new VerificationAttemptInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php new file mode 100644 index 0000000..0272718 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'verificationSid' => Values::array_get($payload, 'verification_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'conversionStatus' => Values::array_get($payload, 'conversion_status'), + 'channel' => Values::array_get($payload, 'channel'), + 'price' => Values::array_get($payload, 'price'), + 'channelData' => Values::array_get($payload, 'channel_data'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VerificationAttemptContext Context for this VerificationAttemptInstance + */ + protected function proxy(): VerificationAttemptContext + { + if (!$this->context) { + $this->context = new VerificationAttemptContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationAttemptInstance + * + * @return VerificationAttemptInstance Fetched VerificationAttemptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationAttemptInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptList.php new file mode 100644 index 0000000..31b5601 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptList.php @@ -0,0 +1,183 @@ +solution = [ + ]; + + $this->uri = '/Attempts'; + } + + /** + * Reads VerificationAttemptInstance 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 VerificationAttemptInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams VerificationAttemptInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VerificationAttemptInstance 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 VerificationAttemptPage Page of VerificationAttemptInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VerificationAttemptPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'ChannelData.To' => + $options['channelDataTo'], + 'Country' => + $options['country'], + 'Channel' => + $options['channel'], + 'VerifyServiceSid' => + $options['verifyServiceSid'], + 'VerificationSid' => + $options['verificationSid'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new VerificationAttemptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of VerificationAttemptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return VerificationAttemptPage Page of VerificationAttemptInstance + */ + public function getPage(string $targetUrl): VerificationAttemptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new VerificationAttemptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a VerificationAttemptContext + * + * @param string $sid The unique SID identifier of a Verification Attempt + */ + public function getContext( + string $sid + + ): VerificationAttemptContext + { + return new VerificationAttemptContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php new file mode 100644 index 0000000..7f99b93 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php @@ -0,0 +1,204 @@ +options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['channelDataTo'] = $channelDataTo; + $this->options['country'] = $country; + $this->options['channel'] = $channel; + $this->options['verifyServiceSid'] = $verifyServiceSid; + $this->options['verificationSid'] = $verificationSid; + $this->options['status'] = $status; + } + + /** + * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * + * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * + * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Destination of a verification. It is phone number in E.164 format. + * + * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. + * @return $this Fluent Builder + */ + public function setChannelDataTo(string $channelDataTo): self + { + $this->options['channelDataTo'] = $channelDataTo; + return $this; + } + + /** + * Filter used to query Verification Attempts sent to the specified destination country. + * + * @param string $country Filter used to query Verification Attempts sent to the specified destination country. + * @return $this Fluent Builder + */ + public function setCountry(string $country): self + { + $this->options['country'] = $country; + return $this; + } + + /** + * Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` + * + * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` + * @return $this Fluent Builder + */ + public function setChannel(string $channel): self + { + $this->options['channel'] = $channel; + return $this; + } + + /** + * Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. + * + * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. + * @return $this Fluent Builder + */ + public function setVerifyServiceSid(string $verifyServiceSid): self + { + $this->options['verifyServiceSid'] = $verifyServiceSid; + return $this; + } + + /** + * Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. + * + * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. + * @return $this Fluent Builder + */ + public function setVerificationSid(string $verificationSid): self + { + $this->options['verificationSid'] = $verificationSid; + return $this; + } + + /** + * Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. + * + * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadVerificationAttemptOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptPage.php new file mode 100644 index 0000000..2a7f358 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationAttemptInstance \Twilio\Rest\Verify\V2\VerificationAttemptInstance + */ + public function buildInstance(array $payload): VerificationAttemptInstance + { + return new VerificationAttemptInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php new file mode 100644 index 0000000..2f29f81 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php @@ -0,0 +1,97 @@ +solution = [ + ]; + + $this->uri = '/Attempts/Summary'; + } + + /** + * Fetch the VerificationAttemptsSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): VerificationAttemptsSummaryInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'VerifyServiceSid' => + $options['verifyServiceSid'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'Country' => + $options['country'], + 'Channel' => + $options['channel'], + 'DestinationPrefix' => + $options['destinationPrefix'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, $params, [], $headers); + + return new VerificationAttemptsSummaryInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptsSummaryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php new file mode 100644 index 0000000..0713d31 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'totalAttempts' => Values::array_get($payload, 'total_attempts'), + 'totalConverted' => Values::array_get($payload, 'total_converted'), + 'totalUnconverted' => Values::array_get($payload, 'total_unconverted'), + 'conversionRatePercentage' => Values::array_get($payload, 'conversion_rate_percentage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VerificationAttemptsSummaryContext Context for this VerificationAttemptsSummaryInstance + */ + protected function proxy(): VerificationAttemptsSummaryContext + { + if (!$this->context) { + $this->context = new VerificationAttemptsSummaryContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationAttemptsSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): VerificationAttemptsSummaryInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptsSummaryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php new file mode 100644 index 0000000..35e56a9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a VerificationAttemptsSummaryContext + */ + public function getContext( + + ): VerificationAttemptsSummaryContext + { + return new VerificationAttemptsSummaryContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptsSummaryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php new file mode 100644 index 0000000..846b1aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php @@ -0,0 +1,166 @@ +options['verifyServiceSid'] = $verifyServiceSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['country'] = $country; + $this->options['channel'] = $channel; + $this->options['destinationPrefix'] = $destinationPrefix; + } + + /** + * Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. + * + * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. + * @return $this Fluent Builder + */ + public function setVerifyServiceSid(string $verifyServiceSid): self + { + $this->options['verifyServiceSid'] = $verifyServiceSid; + return $this; + } + + /** + * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * + * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * + * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. + * + * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. + * @return $this Fluent Builder + */ + public function setCountry(string $country): self + { + $this->options['country'] = $country; + return $this; + } + + /** + * Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` + * + * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` + * @return $this Fluent Builder + */ + public function setChannel(string $channel): self + { + $this->options['channel'] = $channel; + return $this; + } + + /** + * Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. + * + * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. + * @return $this Fluent Builder + */ + public function setDestinationPrefix(string $destinationPrefix): self + { + $this->options['destinationPrefix'] = $destinationPrefix; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.FetchVerificationAttemptsSummaryOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php new file mode 100644 index 0000000..3f5e456 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationAttemptsSummaryInstance \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryInstance + */ + public function buildInstance(array $payload): VerificationAttemptsSummaryInstance + { + return new VerificationAttemptsSummaryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptsSummaryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/VerifyBase.php b/vendor/twilio/sdk/src/Twilio/Rest/VerifyBase.php new file mode 100644 index 0000000..d0f1d8c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/VerifyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://verify.twilio.com'; + } + + + /** + * @return V2 Version v2 of verify + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Verify]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video.php b/vendor/twilio/sdk/src/Twilio/Rest/Video.php new file mode 100644 index 0000000..dea8beb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video.php @@ -0,0 +1,107 @@ +compositions instead. + */ + protected function getCompositions(): \Twilio\Rest\Video\V1\CompositionList { + echo "compositions is deprecated. Use v1->compositions instead."; + return $this->v1->compositions; + } + + /** + * @deprecated Use v1->compositions(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCompositions(string $sid): \Twilio\Rest\Video\V1\CompositionContext { + echo "compositions(\$sid) is deprecated. Use v1->compositions(\$sid) instead."; + return $this->v1->compositions($sid); + } + + /** + * @deprecated Use v1->compositionHooks instead. + */ + protected function getCompositionHooks(): \Twilio\Rest\Video\V1\CompositionHookList { + echo "compositionHooks is deprecated. Use v1->compositionHooks instead."; + return $this->v1->compositionHooks; + } + + /** + * @deprecated Use v1->compositionHooks(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCompositionHooks(string $sid): \Twilio\Rest\Video\V1\CompositionHookContext { + echo "compositionHooks(\$sid) is deprecated. Use v1->compositionHooks(\$sid) instead."; + return $this->v1->compositionHooks($sid); + } + + /** + * @deprecated Use v1->compositionSettings instead. + */ + protected function getCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsList { + echo "compositionSettings is deprecated. Use v1->compositionSettings instead."; + return $this->v1->compositionSettings; + } + + /** + * @deprecated Use v1->compositionSettings() instead. + */ + protected function contextCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsContext { + echo "compositionSettings() is deprecated. Use v1->compositionSettings() instead."; + return $this->v1->compositionSettings(); + } + + /** + * @deprecated Use v1->recordings instead. + */ + protected function getRecordings(): \Twilio\Rest\Video\V1\RecordingList { + echo "recordings is deprecated. Use v1->recordings instead."; + return $this->v1->recordings; + } + + /** + * @deprecated Use v1->recordings(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Video\V1\RecordingContext { + echo "recordings(\$sid) is deprecated. Use v1->recordings(\$sid) instead."; + return $this->v1->recordings($sid); + } + + /** + * @deprecated Use v1->recordingSettings instead. + */ + protected function getRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsList { + echo "recordingSettings is deprecated. Use v1->recordingSettings instead."; + return $this->v1->recordingSettings; + } + + /** + * @deprecated Use v1->recordingSettings() instead. + */ + protected function contextRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsContext { + echo "recordingSettings() is deprecated. Use v1->recordingSettings() instead."; + return $this->v1->recordingSettings(); + } + + /** + * @deprecated Use v1->rooms instead. + */ + protected function getRooms(): \Twilio\Rest\Video\V1\RoomList { + echo "rooms is deprecated. Use v1->rooms instead."; + return $this->v1->rooms; + } + + /** + * @deprecated Use v1->rooms(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRooms(string $sid): \Twilio\Rest\Video\V1\RoomContext { + echo "rooms(\$sid) is deprecated. Use v1->rooms(\$sid) instead."; + return $this->v1->rooms($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1.php new file mode 100644 index 0000000..cfb7cde --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1.php @@ -0,0 +1,153 @@ +version = 'v1'; + } + + protected function getCompositions(): CompositionList + { + if (!$this->_compositions) { + $this->_compositions = new CompositionList($this); + } + return $this->_compositions; + } + + protected function getCompositionHooks(): CompositionHookList + { + if (!$this->_compositionHooks) { + $this->_compositionHooks = new CompositionHookList($this); + } + return $this->_compositionHooks; + } + + protected function getCompositionSettings(): CompositionSettingsList + { + if (!$this->_compositionSettings) { + $this->_compositionSettings = new CompositionSettingsList($this); + } + return $this->_compositionSettings; + } + + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList($this); + } + return $this->_recordings; + } + + protected function getRecordingSettings(): RecordingSettingsList + { + if (!$this->_recordingSettings) { + $this->_recordingSettings = new RecordingSettingsList($this); + } + return $this->_recordingSettings; + } + + protected function getRooms(): RoomList + { + if (!$this->_rooms) { + $this->_rooms = new RoomList($this); + } + return $this->_rooms; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Video.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionContext.php new file mode 100644 index 0000000..af1e251 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionContext.php @@ -0,0 +1,97 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Compositions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CompositionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CompositionInstance + * + * @return CompositionInstance Fetched CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CompositionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php new file mode 100644 index 0000000..8661679 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php @@ -0,0 +1,146 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/CompositionHooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CompositionHookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CompositionHookInstance + * + * @return CompositionHookInstance Fetched CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionHookInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CompositionHookInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Updated CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $options = []): CompositionHookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Trim' => + Serialize::booleanToString($options['trim']), + 'Format' => + $options['format'], + 'Resolution' => + $options['resolution'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new CompositionHookInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionHookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php new file mode 100644 index 0000000..b6ab3b5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'audioSources' => Values::array_get($payload, 'audio_sources'), + 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), + 'videoLayout' => Values::array_get($payload, 'video_layout'), + 'resolution' => Values::array_get($payload, 'resolution'), + 'trim' => Values::array_get($payload, 'trim'), + 'format' => Values::array_get($payload, 'format'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionHookContext Context for this CompositionHookInstance + */ + protected function proxy(): CompositionHookContext + { + if (!$this->context) { + $this->context = new CompositionHookContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CompositionHookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CompositionHookInstance + * + * @return CompositionHookInstance Fetched CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionHookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Updated CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $options = []): CompositionHookInstance + { + + return $this->proxy()->update($friendlyName, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php new file mode 100644 index 0000000..4c9af83 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php @@ -0,0 +1,222 @@ +solution = [ + ]; + + $this->uri = '/CompositionHooks'; + } + + /** + * Create the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Created CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionHookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Resolution' => + $options['resolution'], + 'Format' => + $options['format'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Trim' => + Serialize::booleanToString($options['trim']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CompositionHookInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CompositionHookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CompositionHookInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CompositionHookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CompositionHookInstance 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 CompositionHookPage Page of CompositionHookInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CompositionHookPage + { + $options = new Values($options); + + $params = Values::of([ + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CompositionHookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CompositionHookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CompositionHookPage Page of CompositionHookInstance + */ + public function getPage(string $targetUrl): CompositionHookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CompositionHookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CompositionHookContext + * + * @param string $sid The SID of the CompositionHook resource to delete. + */ + public function getContext( + string $sid + + ): CompositionHookContext + { + return new CompositionHookContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionHookList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php new file mode 100644 index 0000000..1950468 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php @@ -0,0 +1,522 @@ +options['enabled'] = $enabled; + $this->options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['resolution'] = $resolution; + $this->options['format'] = $format; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['trim'] = $trim; + } + + /** + * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. + * + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionHookOptions ' . $options . ']'; + } +} + + + +class ReadCompositionHookOptions extends Options + { + /** + * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. + * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + */ + public function __construct( + + bool $enabled = Values::BOOL_NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $friendlyName = Values::NONE + + ) { + $this->options['enabled'] = $enabled; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * Read only CompositionHook resources with an `enabled` value that matches this parameter. + * + * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + * + * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadCompositionHookOptions ' . $options . ']'; + } +} + +class UpdateCompositionHookOptions extends Options + { + /** + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string $format + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + */ + public function __construct( + + bool $enabled = Values::BOOL_NONE, + array $videoLayout = Values::ARRAY_NONE, + array $audioSources = Values::ARRAY_NONE, + array $audioSourcesExcluded = Values::ARRAY_NONE, + bool $trim = Values::BOOL_NONE, + string $format = Values::NONE, + string $resolution = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE + + ) { + $this->options['enabled'] = $enabled; + $this->options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['trim'] = $trim; + $this->options['format'] = $format; + $this->options['resolution'] = $resolution; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + } + + /** + * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateCompositionHookOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php new file mode 100644 index 0000000..dc91bfe --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionHookInstance \Twilio\Rest\Video\V1\CompositionHookInstance + */ + public function buildInstance(array $payload): CompositionHookInstance + { + return new CompositionHookInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionHookPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php new file mode 100644 index 0000000..e4e22c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), + 'sid' => Values::array_get($payload, 'sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'audioSources' => Values::array_get($payload, 'audio_sources'), + 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), + 'videoLayout' => Values::array_get($payload, 'video_layout'), + 'resolution' => Values::array_get($payload, 'resolution'), + 'trim' => Values::array_get($payload, 'trim'), + 'format' => Values::array_get($payload, 'format'), + 'bitrate' => Values::array_get($payload, 'bitrate'), + 'size' => Values::array_get($payload, 'size'), + 'duration' => Values::array_get($payload, 'duration'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionContext Context for this CompositionInstance + */ + protected function proxy(): CompositionContext + { + if (!$this->context) { + $this->context = new CompositionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CompositionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CompositionInstance + * + * @return CompositionInstance Fetched CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionList.php new file mode 100644 index 0000000..fb20f1e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionList.php @@ -0,0 +1,220 @@ +solution = [ + ]; + + $this->uri = '/Compositions'; + } + + /** + * Create the CompositionInstance + * + * @param string $roomSid The SID of the Group Room with the media tracks to be used as composition sources. + * @param array|Options $options Optional Arguments + * @return CompositionInstance Created CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $roomSid, array $options = []): CompositionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoomSid' => + $roomSid, + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Resolution' => + $options['resolution'], + 'Format' => + $options['format'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Trim' => + Serialize::booleanToString($options['trim']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CompositionInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CompositionInstance 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 CompositionPage Page of CompositionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CompositionPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'RoomSid' => + $options['roomSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CompositionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CompositionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CompositionPage Page of CompositionInstance + */ + public function getPage(string $targetUrl): CompositionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CompositionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CompositionContext + * + * @param string $sid The SID of the Composition resource to delete. + */ + public function getContext( + string $sid + + ): CompositionContext + { + return new CompositionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php new file mode 100644 index 0000000..27a5f92 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php @@ -0,0 +1,310 @@ +options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['resolution'] = $resolution; + $this->options['format'] = $format; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['trim'] = $trim; + } + + /** + * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * + * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * + * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionOptions ' . $options . ']'; + } +} + + + +class ReadCompositionOptions extends Options + { + /** + * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. + * @param string $roomSid Read only Composition resources with this Room SID. + */ + public function __construct( + + string $status = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $roomSid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['roomSid'] = $roomSid; + } + + /** + * Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * + * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * + * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Composition resources created before this ISO 8601 date-time with time zone. + * + * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only Composition resources with this Room SID. + * + * @param string $roomSid Read only Composition resources with this Room SID. + * @return $this Fluent Builder + */ + public function setRoomSid(string $roomSid): self + { + $this->options['roomSid'] = $roomSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadCompositionOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionPage.php new file mode 100644 index 0000000..017ca8e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionInstance \Twilio\Rest\Video\V1\CompositionInstance + */ + public function buildInstance(array $payload): CompositionInstance + { + return new CompositionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php new file mode 100644 index 0000000..5f5a5e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php @@ -0,0 +1,117 @@ +solution = [ + ]; + + $this->uri = '/CompositionSettings/Default'; + } + + /** + * Create the CompositionSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console + * @param array|Options $options Optional Arguments + * @return CompositionSettingsInstance Created CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionSettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'AwsCredentialsSid' => + $options['awsCredentialsSid'], + 'EncryptionKeySid' => + $options['encryptionKeySid'], + 'AwsS3Url' => + $options['awsS3Url'], + 'AwsStorageEnabled' => + Serialize::booleanToString($options['awsStorageEnabled']), + 'EncryptionEnabled' => + Serialize::booleanToString($options['encryptionEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CompositionSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Fetch the CompositionSettingsInstance + * + * @return CompositionSettingsInstance Fetched CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionSettingsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CompositionSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionSettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php new file mode 100644 index 0000000..fdd7a9c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), + 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), + 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), + 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), + 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionSettingsContext Context for this CompositionSettingsInstance + */ + protected function proxy(): CompositionSettingsContext + { + if (!$this->context) { + $this->context = new CompositionSettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the CompositionSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console + * @param array|Options $options Optional Arguments + * @return CompositionSettingsInstance Created CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionSettingsInstance + { + + return $this->proxy()->create($friendlyName, $options); + } + + /** + * Fetch the CompositionSettingsInstance + * + * @return CompositionSettingsInstance Fetched CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionSettingsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionSettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php new file mode 100644 index 0000000..2798b4e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a CompositionSettingsContext + */ + public function getContext( + + ): CompositionSettingsContext + { + return new CompositionSettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionSettingsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php new file mode 100644 index 0000000..3fa7115 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php @@ -0,0 +1,150 @@ +options['awsCredentialsSid'] = $awsCredentialsSid; + $this->options['encryptionKeySid'] = $encryptionKeySid; + $this->options['awsS3Url'] = $awsS3Url; + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + $this->options['encryptionEnabled'] = $encryptionEnabled; + } + + /** + * The SID of the stored Credential resource. + * + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @return $this Fluent Builder + */ + public function setAwsCredentialsSid(string $awsCredentialsSid): self + { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + return $this; + } + + /** + * The SID of the Public Key resource to use for encryption. + * + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @return $this Fluent Builder + */ + public function setEncryptionKeySid(string $encryptionKeySid): self + { + $this->options['encryptionKeySid'] = $encryptionKeySid; + return $this; + } + + /** + * The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + * + * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + * @return $this Fluent Builder + */ + public function setAwsS3Url(string $awsS3Url): self + { + $this->options['awsS3Url'] = $awsS3Url; + return $this; + } + + /** + * Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * + * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * @return $this Fluent Builder + */ + public function setAwsStorageEnabled(bool $awsStorageEnabled): self + { + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + return $this; + } + + /** + * Whether all compositions should be stored in an encrypted form. The default is `false`. + * + * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. + * @return $this Fluent Builder + */ + public function setEncryptionEnabled(bool $encryptionEnabled): self + { + $this->options['encryptionEnabled'] = $encryptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionSettingsOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php new file mode 100644 index 0000000..44b145e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionSettingsInstance \Twilio\Rest\Video\V1\CompositionSettingsInstance + */ + public function buildInstance(array $payload): CompositionSettingsInstance + { + return new CompositionSettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionSettingsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingContext.php new file mode 100644 index 0000000..7347318 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingContext.php @@ -0,0 +1,97 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Recordings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php new file mode 100644 index 0000000..a702add --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'sid' => Values::array_get($payload, 'sid'), + 'sourceSid' => Values::array_get($payload, 'source_sid'), + 'size' => Values::array_get($payload, 'size'), + 'url' => Values::array_get($payload, 'url'), + 'type' => Values::array_get($payload, 'type'), + 'duration' => Values::array_get($payload, 'duration'), + 'containerFormat' => Values::array_get($payload, 'container_format'), + 'codec' => Values::array_get($payload, 'codec'), + 'groupingSids' => Values::array_get($payload, 'grouping_sids'), + 'trackName' => Values::array_get($payload, 'track_name'), + 'offset' => Values::array_get($payload, 'offset'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingList.php new file mode 100644 index 0000000..c4741c0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/Recordings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance 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 RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'SourceSid' => + $options['sourceSid'], + 'GroupingSid' => + Serialize::map($options['groupingSid'], function ($e) { return $e; }), + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'MediaType' => + $options['mediaType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The SID of the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php new file mode 100644 index 0000000..9615c48 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php @@ -0,0 +1,170 @@ +options['status'] = $status; + $this->options['sourceSid'] = $sourceSid; + $this->options['groupingSid'] = $groupingSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['mediaType'] = $mediaType; + } + + /** + * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. + * + * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the recordings that have this `source_sid`. + * + * @param string $sourceSid Read only the recordings that have this `source_sid`. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. + * + * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. + * @return $this Fluent Builder + */ + public function setGroupingSid(array $groupingSid): self + { + $this->options['groupingSid'] = $groupingSid; + return $this; + } + + /** + * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * + * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. + * + * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only recordings that have this media type. Can be either `audio` or `video`. + * + * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. + * @return $this Fluent Builder + */ + public function setMediaType(string $mediaType): self + { + $this->options['mediaType'] = $mediaType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingPage.php new file mode 100644 index 0000000..c79ff55 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Video\V1\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php new file mode 100644 index 0000000..c20ab9c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php @@ -0,0 +1,117 @@ +solution = [ + ]; + + $this->uri = '/RecordingSettings/Default'; + } + + /** + * Create the RecordingSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console + * @param array|Options $options Optional Arguments + * @return RecordingSettingsInstance Created RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): RecordingSettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'AwsCredentialsSid' => + $options['awsCredentialsSid'], + 'EncryptionKeySid' => + $options['encryptionKeySid'], + 'AwsS3Url' => + $options['awsS3Url'], + 'AwsStorageEnabled' => + Serialize::booleanToString($options['awsStorageEnabled']), + 'EncryptionEnabled' => + Serialize::booleanToString($options['encryptionEnabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RecordingSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Fetch the RecordingSettingsInstance + * + * @return RecordingSettingsInstance Fetched RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingSettingsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingSettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php new file mode 100644 index 0000000..23ac56f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), + 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), + 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), + 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), + 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingSettingsContext Context for this RecordingSettingsInstance + */ + protected function proxy(): RecordingSettingsContext + { + if (!$this->context) { + $this->context = new RecordingSettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the RecordingSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console + * @param array|Options $options Optional Arguments + * @return RecordingSettingsInstance Created RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): RecordingSettingsInstance + { + + return $this->proxy()->create($friendlyName, $options); + } + + /** + * Fetch the RecordingSettingsInstance + * + * @return RecordingSettingsInstance Fetched RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingSettingsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingSettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php new file mode 100644 index 0000000..72b7e0e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a RecordingSettingsContext + */ + public function getContext( + + ): RecordingSettingsContext + { + return new RecordingSettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingSettingsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php new file mode 100644 index 0000000..7bab285 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php @@ -0,0 +1,150 @@ +options['awsCredentialsSid'] = $awsCredentialsSid; + $this->options['encryptionKeySid'] = $encryptionKeySid; + $this->options['awsS3Url'] = $awsS3Url; + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + $this->options['encryptionEnabled'] = $encryptionEnabled; + } + + /** + * The SID of the stored Credential resource. + * + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @return $this Fluent Builder + */ + public function setAwsCredentialsSid(string $awsCredentialsSid): self + { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + return $this; + } + + /** + * The SID of the Public Key resource to use for encryption. + * + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @return $this Fluent Builder + */ + public function setEncryptionKeySid(string $encryptionKeySid): self + { + $this->options['encryptionKeySid'] = $encryptionKeySid; + return $this; + } + + /** + * The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + * + * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). + * @return $this Fluent Builder + */ + public function setAwsS3Url(string $awsS3Url): self + { + $this->options['awsS3Url'] = $awsS3Url; + return $this; + } + + /** + * Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * + * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * @return $this Fluent Builder + */ + public function setAwsStorageEnabled(bool $awsStorageEnabled): self + { + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + return $this; + } + + /** + * Whether all recordings should be stored in an encrypted form. The default is `false`. + * + * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. + * @return $this Fluent Builder + */ + public function setEncryptionEnabled(bool $encryptionEnabled): self + { + $this->options['encryptionEnabled'] = $encryptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateRecordingSettingsOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php new file mode 100644 index 0000000..5812d5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingSettingsInstance \Twilio\Rest\Video\V1\RecordingSettingsInstance + */ + public function buildInstance(array $payload): RecordingSettingsInstance + { + return new RecordingSettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingSettingsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php new file mode 100644 index 0000000..e60ebb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php @@ -0,0 +1,89 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($sid) + .'/Anonymize'; + } + + /** + * Update the AnonymizeInstance + * + * @return AnonymizeInstance Updated AnonymizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AnonymizeInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], [], $headers); + + return new AnonymizeInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.AnonymizeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php new file mode 100644 index 0000000..8bc1a7a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php @@ -0,0 +1,138 @@ +properties = [ + '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'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AnonymizeContext Context for this AnonymizeInstance + */ + protected function proxy(): AnonymizeContext + { + if (!$this->context) { + $this->context = new AnonymizeContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the AnonymizeInstance + * + * @return AnonymizeInstance Updated AnonymizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AnonymizeInstance + { + + return $this->proxy()->update(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.AnonymizeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php new file mode 100644 index 0000000..0b6afa2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php @@ -0,0 +1,73 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a AnonymizeContext + */ + public function getContext( + + ): AnonymizeContext + { + return new AnonymizeContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.AnonymizeList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php new file mode 100644 index 0000000..b71f0aa --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AnonymizeInstance \Twilio\Rest\Video\V1\Room\Participant\AnonymizeInstance + */ + public function buildInstance(array $payload): AnonymizeInstance + { + return new AnonymizeInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.AnonymizePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php new file mode 100644 index 0000000..547b8ee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php @@ -0,0 +1,95 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/PublishedTracks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PublishedTrackInstance + * + * @return PublishedTrackInstance Fetched PublishedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublishedTrackInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + 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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.PublishedTrackContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php new file mode 100644 index 0000000..4a0b7b9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php @@ -0,0 +1,136 @@ +properties = [ + '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 = ['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 PublishedTrackContext Context for this PublishedTrackInstance + */ + protected function proxy(): PublishedTrackContext + { + if (!$this->context) { + $this->context = new PublishedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PublishedTrackInstance + * + * @return PublishedTrackInstance Fetched PublishedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublishedTrackInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.PublishedTrackInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php new file mode 100644 index 0000000..323c6c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php @@ -0,0 +1,175 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/PublishedTracks'; + } + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 PublishedTrackPage Page of PublishedTrackInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PublishedTrackPage + { + + $params = Values::of([ + '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 PublishedTrackPage Page of PublishedTrackInstance + */ + public function getPage(string $targetUrl): PublishedTrackPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PublishedTrackPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PublishedTrackContext + * + * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. + */ + public function getContext( + string $sid + + ): PublishedTrackContext + { + return new PublishedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.PublishedTrackList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php new file mode 100644 index 0000000..ef92e8c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PublishedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackInstance + */ + public function buildInstance(array $payload): PublishedTrackInstance + { + return new PublishedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.PublishedTrackPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php new file mode 100644 index 0000000..fc62c44 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php @@ -0,0 +1,91 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'rules' => Values::array_get($payload, 'rules'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php new file mode 100644 index 0000000..1daa80f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php @@ -0,0 +1,117 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribeRules'; + } + + /** + * Fetch the SubscribeRulesInstance + * + * @return SubscribeRulesInstance Fetched SubscribeRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribeRulesInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SubscribeRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Update the SubscribeRulesInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribeRulesInstance Updated SubscribeRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribeRulesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Rules' => + Serialize::jsonObject($options['rules']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SubscribeRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php new file mode 100644 index 0000000..656889b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php @@ -0,0 +1,78 @@ +options['rules'] = $rules; + } + + /** + * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. + * + * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. + * @return $this Fluent Builder + */ + public function setRules(array $rules): self + { + $this->options['rules'] = $rules; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateSubscribeRulesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php new file mode 100644 index 0000000..e768c7b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribeRulesInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesInstance + */ + public function buildInstance(array $payload): SubscribeRulesInstance + { + return new SubscribeRulesInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php new file mode 100644 index 0000000..74652c9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php @@ -0,0 +1,95 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribedTracks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SubscribedTrackInstance + * + * @return SubscribedTrackInstance Fetched SubscribedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedTrackInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SubscribedTrackInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.SubscribedTrackContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php new file mode 100644 index 0000000..4efb767 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'publisherSid' => Values::array_get($payload, 'publisher_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'name' => Values::array_get($payload, 'name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'enabled' => Values::array_get($payload, 'enabled'), + 'kind' => Values::array_get($payload, 'kind'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['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 SubscribedTrackContext Context for this SubscribedTrackInstance + */ + protected function proxy(): SubscribedTrackContext + { + if (!$this->context) { + $this->context = new SubscribedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SubscribedTrackInstance + * + * @return SubscribedTrackInstance Fetched SubscribedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedTrackInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.SubscribedTrackInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php new file mode 100644 index 0000000..79d6b80 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php @@ -0,0 +1,175 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribedTracks'; + } + + /** + * Reads SubscribedTrackInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SubscribedTrackInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SubscribedTrackInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscribedTrackInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SubscribedTrackPage Page of SubscribedTrackInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscribedTrackPage + { + + $params = Values::of([ + '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 SubscribedTrackPage Page of SubscribedTrackInstance + */ + public function getPage(string $targetUrl): SubscribedTrackPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscribedTrackPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscribedTrackContext + * + * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. + */ + public function getContext( + string $sid + + ): SubscribedTrackContext + { + return new SubscribedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribedTrackList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php new file mode 100644 index 0000000..575fa82 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackInstance + */ + public function buildInstance(array $payload): SubscribedTrackInstance + { + return new SubscribedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribedTrackPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php new file mode 100644 index 0000000..cc7f3c3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php @@ -0,0 +1,237 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the subscribeRules + */ + protected function getSubscribeRules(): SubscribeRulesList + { + if (!$this->_subscribeRules) { + $this->_subscribeRules = new SubscribeRulesList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_subscribeRules; + } + + /** + * Access the subscribedTracks + */ + protected function getSubscribedTracks(): SubscribedTrackList + { + if (!$this->_subscribedTracks) { + $this->_subscribedTracks = new SubscribedTrackList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_subscribedTracks; + } + + /** + * Access the publishedTracks + */ + protected function getPublishedTracks(): PublishedTrackList + { + if (!$this->_publishedTracks) { + $this->_publishedTracks = new PublishedTrackList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_publishedTracks; + } + + /** + * Access the anonymize + */ + protected function getAnonymize(): AnonymizeList + { + if (!$this->_anonymize) { + $this->_anonymize = new AnonymizeList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_anonymize; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php new file mode 100644 index 0000000..62a1952 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php @@ -0,0 +1,195 @@ +properties = [ + '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 = ['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 ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the subscribeRules + */ + protected function getSubscribeRules(): SubscribeRulesList + { + return $this->proxy()->subscribeRules; + } + + /** + * Access the subscribedTracks + */ + protected function getSubscribedTracks(): SubscribedTrackList + { + return $this->proxy()->subscribedTracks; + } + + /** + * Access the publishedTracks + */ + protected function getPublishedTracks(): PublishedTrackList + { + return $this->proxy()->publishedTracks; + } + + /** + * Access the anonymize + */ + protected function getAnonymize(): AnonymizeList + { + return $this->proxy()->anonymize; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php new file mode 100644 index 0000000..f76e23e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php @@ -0,0 +1,182 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + '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 ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid The SID of the RoomParticipant resource to fetch. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.ParticipantList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php new file mode 100644 index 0000000..9b7a71b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php @@ -0,0 +1,182 @@ +options['status'] = $status; + $this->options['identity'] = $identity; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. + * + * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. + * + * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * + * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * + * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadParticipantOptions ' . $options . ']'; + } +} + +class UpdateParticipantOptions extends Options + { + /** + * @param string $status + */ + public function __construct( + + string $status = Values::NONE + + ) { + $this->options['status'] = $status; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php new file mode 100644 index 0000000..63f45f8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Video\V1\Room\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.ParticipantPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php new file mode 100644 index 0000000..d4046f5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'rules' => Values::array_get($payload, 'rules'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['roomSid' => $roomSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php new file mode 100644 index 0000000..5901faf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php @@ -0,0 +1,109 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/RecordingRules'; + } + + /** + * Fetch the RecordingRulesInstance + * + * @return RecordingRulesInstance Fetched RecordingRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingRulesInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RecordingRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Update the RecordingRulesInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingRulesInstance Updated RecordingRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingRulesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Rules' => + Serialize::jsonObject($options['rules']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RecordingRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php new file mode 100644 index 0000000..0f7bdb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php @@ -0,0 +1,78 @@ +options['rules'] = $rules; + } + + /** + * A JSON-encoded array of recording rules. + * + * @param array $rules A JSON-encoded array of recording rules. + * @return $this Fluent Builder + */ + public function setRules(array $rules): self + { + $this->options['rules'] = $rules; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateRecordingRulesOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php new file mode 100644 index 0000000..4688db6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingRulesInstance \Twilio\Rest\Video\V1\Room\RecordingRulesInstance + */ + public function buildInstance(array $payload): RecordingRulesInstance + { + return new RecordingRulesInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php new file mode 100644 index 0000000..e77b551 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php @@ -0,0 +1,103 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Recordings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoomRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RoomRecordingInstance + * + * @return RoomRecordingInstance Fetched RoomRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomRecordingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoomRecordingInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomRecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php new file mode 100644 index 0000000..748d05a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'sid' => Values::array_get($payload, 'sid'), + 'sourceSid' => Values::array_get($payload, 'source_sid'), + 'size' => Values::array_get($payload, 'size'), + 'url' => Values::array_get($payload, 'url'), + 'type' => Values::array_get($payload, 'type'), + 'duration' => Values::array_get($payload, 'duration'), + 'containerFormat' => Values::array_get($payload, 'container_format'), + 'codec' => Values::array_get($payload, 'codec'), + 'groupingSids' => Values::array_get($payload, 'grouping_sids'), + 'trackName' => Values::array_get($payload, 'track_name'), + 'offset' => Values::array_get($payload, 'offset'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['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 RoomRecordingContext Context for this RoomRecordingInstance + */ + protected function proxy(): RoomRecordingContext + { + if (!$this->context) { + $this->context = new RoomRecordingContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoomRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoomRecordingInstance + * + * @return RoomRecordingInstance Fetched RoomRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomRecordingInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomRecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php new file mode 100644 index 0000000..5f9d6ca --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php @@ -0,0 +1,182 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Recordings'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomRecordingInstance 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 RoomRecordingPage Page of RoomRecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomRecordingPage + { + $options = new Values($options); + + $params = Values::of([ + '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 RoomRecordingPage Page of RoomRecordingInstance + */ + public function getPage(string $targetUrl): RoomRecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomRecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomRecordingContext + * + * @param string $sid The SID of the RoomRecording resource to delete. + */ + public function getContext( + string $sid + + ): RoomRecordingContext + { + return new RoomRecordingContext( + $this->version, + $this->solution['roomSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomRecordingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php new file mode 100644 index 0000000..35fde86 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php @@ -0,0 +1,134 @@ +options['status'] = $status; + $this->options['sourceSid'] = $sourceSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. + * + * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the recordings that have this `source_sid`. + * + * @param string $sourceSid Read only the recordings that have this `source_sid`. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRoomRecordingOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php new file mode 100644 index 0000000..9fa95c2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomRecordingInstance \Twilio\Rest\Video\V1\Room\RoomRecordingInstance + */ + public function buildInstance(array $payload): RoomRecordingInstance + { + return new RoomRecordingInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomRecordingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomContext.php new file mode 100644 index 0000000..df2773f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomContext.php @@ -0,0 +1,204 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RoomInstance + * + * @param string $status + * @return RoomInstance Updated RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): RoomInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the recordingRules + */ + protected function getRecordingRules(): RecordingRulesList + { + if (!$this->_recordingRules) { + $this->_recordingRules = new RecordingRulesList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordingRules; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RoomRecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RoomRecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomInstance.php new file mode 100644 index 0000000..e180ae0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomInstance.php @@ -0,0 +1,206 @@ +properties = [ + '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'), + 'maxParticipantDuration' => Values::array_get($payload, 'max_participant_duration'), + 'maxConcurrentPublishedTracks' => Values::array_get($payload, 'max_concurrent_published_tracks'), + 'recordParticipantsOnConnect' => Values::array_get($payload, 'record_participants_on_connect'), + 'videoCodecs' => Values::array_get($payload, 'video_codecs'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'audioOnly' => Values::array_get($payload, 'audio_only'), + 'emptyRoomTimeout' => Values::array_get($payload, 'empty_room_timeout'), + 'unusedRoomTimeout' => Values::array_get($payload, 'unused_room_timeout'), + 'largeRoom' => Values::array_get($payload, 'large_room'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoomContext Context for this RoomInstance + */ + protected function proxy(): RoomContext + { + if (!$this->context) { + $this->context = new RoomContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoomInstance + * + * @param string $status + * @return RoomInstance Updated RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): RoomInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the recordingRules + */ + protected function getRecordingRules(): RecordingRulesList + { + return $this->proxy()->recordingRules; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RoomRecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomList.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomList.php new file mode 100644 index 0000000..e3f2242 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomList.php @@ -0,0 +1,231 @@ +solution = [ + ]; + + $this->uri = '/Rooms'; + } + + /** + * Create the RoomInstance + * + * @param array|Options $options Optional Arguments + * @return RoomInstance Created RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RoomInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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' => + $options['videoCodecs'], + 'MediaRegion' => + $options['mediaRegion'], + 'RecordingRules' => + Serialize::jsonObject($options['recordingRules']), + 'AudioOnly' => + Serialize::booleanToString($options['audioOnly']), + 'MaxParticipantDuration' => + $options['maxParticipantDuration'], + 'EmptyRoomTimeout' => + $options['emptyRoomTimeout'], + 'UnusedRoomTimeout' => + $options['unusedRoomTimeout'], + 'LargeRoom' => + Serialize::booleanToString($options['largeRoom']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RoomInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomInstance 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 RoomPage Page of RoomInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomPage + { + $options = new Values($options); + + $params = Values::of([ + '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 RoomPage Page of RoomInstance + */ + public function getPage(string $targetUrl): RoomPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomContext + * + * @param string $sid The SID of the Room resource to fetch. + */ + public function getContext( + string $sid + + ): RoomContext + { + return new RoomContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomOptions.php new file mode 100644 index 0000000..cd24833 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomOptions.php @@ -0,0 +1,436 @@ +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; + $this->options['recordingRules'] = $recordingRules; + $this->options['audioOnly'] = $audioOnly; + $this->options['maxParticipantDuration'] = $maxParticipantDuration; + $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; + $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; + $this->options['largeRoom'] = $largeRoom; + } + + /** + * Deprecated, now always considered to be true. + * + * @param bool $enableTurn Deprecated, now always considered to be true. + * @return $this Fluent Builder + */ + public function setEnableTurn(bool $enableTurn): self + { + $this->options['enableTurn'] = $enableTurn; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. + * + * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** + * + * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** + * @return $this Fluent Builder + */ + public function setRecordParticipantsOnConnect(bool $recordParticipantsOnConnect): self + { + $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; + return $this; + } + + /** + * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** + * + * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** + * @return $this Fluent Builder + */ + public function setVideoCodecs(array $videoCodecs): self + { + $this->options['videoCodecs'] = $videoCodecs; + return $this; + } + + /** + * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + * + * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + * @return $this Fluent Builder + */ + public function setMediaRegion(string $mediaRegion): self + { + $this->options['mediaRegion'] = $mediaRegion; + return $this; + } + + /** + * A collection of Recording Rules that describe how to include or exclude matching tracks for recording + * + * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording + * @return $this Fluent Builder + */ + public function setRecordingRules(array $recordingRules): self + { + $this->options['recordingRules'] = $recordingRules; + return $this; + } + + /** + * When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + * + * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + * @return $this Fluent Builder + */ + public function setAudioOnly(bool $audioOnly): self + { + $this->options['audioOnly'] = $audioOnly; + return $this; + } + + /** + * The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). + * + * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). + * @return $this Fluent Builder + */ + public function setMaxParticipantDuration(int $maxParticipantDuration): self + { + $this->options['maxParticipantDuration'] = $maxParticipantDuration; + return $this; + } + + /** + * Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). + * + * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). + * @return $this Fluent Builder + */ + public function setEmptyRoomTimeout(int $emptyRoomTimeout): self + { + $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; + return $this; + } + + /** + * Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). + * + * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). + * @return $this Fluent Builder + */ + public function setUnusedRoomTimeout(int $unusedRoomTimeout): self + { + $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; + return $this; + } + + /** + * When set to true, indicated that this is the large room. + * + * @param bool $largeRoom When set to true, indicated that this is the large room. + * @return $this Fluent Builder + */ + public function setLargeRoom(bool $largeRoom): self + { + $this->options['largeRoom'] = $largeRoom; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateRoomOptions ' . $options . ']'; + } +} + + +class ReadRoomOptions extends Options + { + /** + * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * @param string $uniqueName Read only rooms with the this `unique_name`. + * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. + */ + public function __construct( + + string $status = Values::NONE, + string $uniqueName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null + + ) { + $this->options['status'] = $status; + $this->options['uniqueName'] = $uniqueName; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * + * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only rooms with the this `unique_name`. + * + * @param string $uniqueName Read only rooms with the this `unique_name`. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * + * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only rooms that started before this date, given as `YYYY-MM-DD`. + * + * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRoomOptions ' . $options . ']'; + } +} + + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomPage.php new file mode 100644 index 0000000..f23e6ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Video/V1/RoomPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomInstance \Twilio\Rest\Video\V1\RoomInstance + */ + public function buildInstance(array $payload): RoomInstance + { + return new RoomInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/VideoBase.php b/vendor/twilio/sdk/src/Twilio/Rest/VideoBase.php new file mode 100644 index 0000000..afd633b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/VideoBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://video.twilio.com'; + } + + + /** + * @return V1 Version v1 of video + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Video]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice.php new file mode 100644 index 0000000..41e24ad --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice.php @@ -0,0 +1,101 @@ +archivedCalls instead. + */ + protected function getArchivedCalls(): \Twilio\Rest\Voice\V1\ArchivedCallList { + echo "archivedCalls is deprecated. Use v1->archivedCalls instead."; + return $this->v1->archivedCalls; + } + + /** + * @deprecated Use v1->archivedCalls(\$date, \$sid) instead. + * @param \DateTime $date The date of the Call in UTC. + * @param string $sid The unique string that identifies this resource + */ + protected function contextArchivedCalls(\DateTime $date, string $sid): \Twilio\Rest\Voice\V1\ArchivedCallContext { + echo "archivedCalls(\$date, \$sid) is deprecated. Use v1->archivedCalls(\$date, \$sid) instead."; + return $this->v1->archivedCalls($date, $sid); + } + + /** + * @deprecated Use v1->byocTrunks instead. + */ + protected function getByocTrunks(): \Twilio\Rest\Voice\V1\ByocTrunkList { + echo "byocTrunks is deprecated. Use v1->byocTrunks instead."; + return $this->v1->byocTrunks; + } + + /** + * @deprecated Use v1->byocTrunks(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextByocTrunks(string $sid): \Twilio\Rest\Voice\V1\ByocTrunkContext { + echo "byocTrunks(\$sid) is deprecated. Use v1->byocTrunks(\$sid) instead."; + return $this->v1->byocTrunks($sid); + } + + /** + * @deprecated Use v1->connectionPolicies instead. + */ + protected function getConnectionPolicies(): \Twilio\Rest\Voice\V1\ConnectionPolicyList { + echo "connectionPolicies is deprecated. Use v1->connectionPolicies instead."; + return $this->v1->connectionPolicies; + } + + /** + * @deprecated Use v1->connectionPolicies(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextConnectionPolicies(string $sid): \Twilio\Rest\Voice\V1\ConnectionPolicyContext { + echo "connectionPolicies(\$sid) is deprecated. Use v1->connectionPolicies(\$sid) instead."; + return $this->v1->connectionPolicies($sid); + } + + /** + * @deprecated Use v1->dialingPermissions instead. + */ + protected function getDialingPermissions(): \Twilio\Rest\Voice\V1\DialingPermissionsList { + echo "dialingPermissions is deprecated. Use v1->dialingPermissions instead."; + return $this->v1->dialingPermissions; + } + + /** + * @deprecated Use v1->ipRecords instead. + */ + protected function getIpRecords(): \Twilio\Rest\Voice\V1\IpRecordList { + echo "ipRecords is deprecated. Use v1->ipRecords instead."; + return $this->v1->ipRecords; + } + + /** + * @deprecated Use v1->ipRecords(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextIpRecords(string $sid): \Twilio\Rest\Voice\V1\IpRecordContext { + echo "ipRecords(\$sid) is deprecated. Use v1->ipRecords(\$sid) instead."; + return $this->v1->ipRecords($sid); + } + + /** + * @deprecated Use v1->sourceIpMappings instead. + */ + protected function getSourceIpMappings(): \Twilio\Rest\Voice\V1\SourceIpMappingList { + echo "sourceIpMappings is deprecated. Use v1->sourceIpMappings instead."; + return $this->v1->sourceIpMappings; + } + + /** + * @deprecated Use v1->sourceIpMappings(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextSourceIpMappings(string $sid): \Twilio\Rest\Voice\V1\SourceIpMappingContext { + echo "sourceIpMappings(\$sid) is deprecated. Use v1->sourceIpMappings(\$sid) instead."; + return $this->v1->sourceIpMappings($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1.php new file mode 100644 index 0000000..eb2e92b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1.php @@ -0,0 +1,154 @@ +version = 'v1'; + } + + protected function getArchivedCalls(): ArchivedCallList + { + if (!$this->_archivedCalls) { + $this->_archivedCalls = new ArchivedCallList($this); + } + return $this->_archivedCalls; + } + + protected function getByocTrunks(): ByocTrunkList + { + if (!$this->_byocTrunks) { + $this->_byocTrunks = new ByocTrunkList($this); + } + return $this->_byocTrunks; + } + + protected function getConnectionPolicies(): ConnectionPolicyList + { + if (!$this->_connectionPolicies) { + $this->_connectionPolicies = new ConnectionPolicyList($this); + } + return $this->_connectionPolicies; + } + + protected function getDialingPermissions(): DialingPermissionsList + { + if (!$this->_dialingPermissions) { + $this->_dialingPermissions = new DialingPermissionsList($this); + } + return $this->_dialingPermissions; + } + + protected function getIpRecords(): IpRecordList + { + if (!$this->_ipRecords) { + $this->_ipRecords = new IpRecordList($this); + } + return $this->_ipRecords; + } + + protected function getSourceIpMappings(): SourceIpMappingList + { + if (!$this->_sourceIpMappings) { + $this->_sourceIpMappings = new SourceIpMappingList($this); + } + return $this->_sourceIpMappings; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Voice.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallContext.php new file mode 100644 index 0000000..7a44bab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallContext.php @@ -0,0 +1,82 @@ +solution = [ + 'date' => + $date, + 'sid' => + $sid, + ]; + + $this->uri = '/Archives/' . \rawurlencode($date->format('Y-m-d')) + .'/Calls/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ArchivedCallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ArchivedCallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallInstance.php new file mode 100644 index 0000000..d086357 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallInstance.php @@ -0,0 +1,108 @@ +solution = ['date' => $date ?: $this->properties['date'], 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ArchivedCallContext Context for this ArchivedCallInstance + */ + protected function proxy(): ArchivedCallContext + { + if (!$this->context) { + $this->context = new ArchivedCallContext( + $this->version, + $this->solution['date'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ArchivedCallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ArchivedCallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallList.php new file mode 100644 index 0000000..963f2be --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a ArchivedCallContext + * + * @param \DateTime $date The date of the Call in UTC. + * + * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete + */ + public function getContext( + \DateTime $date + , string $sid + + ): ArchivedCallContext + { + return new ArchivedCallContext( + $this->version, + $date, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ArchivedCallList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallPage.php new file mode 100644 index 0000000..711f5cf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ArchivedCallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ArchivedCallInstance \Twilio\Rest\Voice\V1\ArchivedCallInstance + */ + public function buildInstance(array $payload): ArchivedCallInstance + { + return new ArchivedCallInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ArchivedCallPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php new file mode 100644 index 0000000..b110f81 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php @@ -0,0 +1,145 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ByocTrunks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ByocTrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ByocTrunkInstance + * + * @return ByocTrunkInstance Fetched ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ByocTrunkInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ByocTrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Updated ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ByocTrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'ConnectionPolicySid' => + $options['connectionPolicySid'], + 'FromDomainSid' => + $options['fromDomainSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ByocTrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ByocTrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkInstance.php new file mode 100644 index 0000000..f82535c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'statusCallbackUrl' => Values::array_get($payload, 'status_callback_url'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), + 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), + 'fromDomainSid' => Values::array_get($payload, 'from_domain_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ByocTrunkContext Context for this ByocTrunkInstance + */ + protected function proxy(): ByocTrunkContext + { + if (!$this->context) { + $this->context = new ByocTrunkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ByocTrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ByocTrunkInstance + * + * @return ByocTrunkInstance Fetched ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ByocTrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Updated ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ByocTrunkInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ByocTrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkList.php new file mode 100644 index 0000000..49be094 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkList.php @@ -0,0 +1,209 @@ +solution = [ + ]; + + $this->uri = '/ByocTrunks'; + } + + /** + * Create the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Created ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ByocTrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'ConnectionPolicySid' => + $options['connectionPolicySid'], + 'FromDomainSid' => + $options['fromDomainSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ByocTrunkInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ByocTrunkInstance 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 ByocTrunkInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ByocTrunkInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ByocTrunkInstance 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 ByocTrunkPage Page of ByocTrunkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ByocTrunkPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ByocTrunkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ByocTrunkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ByocTrunkPage Page of ByocTrunkInstance + */ + public function getPage(string $targetUrl): ByocTrunkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ByocTrunkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ByocTrunkContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. + */ + public function getContext( + string $sid + + ): ByocTrunkContext + { + return new ByocTrunkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ByocTrunkList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkOptions.php new file mode 100644 index 0000000..b57886d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkOptions.php @@ -0,0 +1,458 @@ +options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['connectionPolicySid'] = $connectionPolicySid; + $this->options['fromDomainSid'] = $fromDomainSid; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when the BYOC Trunk receives a call. + * + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @return $this Fluent Builder + */ + public function setConnectionPolicySid(string $connectionPolicySid): self + { + $this->options['connectionPolicySid'] = $connectionPolicySid; + return $this; + } + + /** + * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * @return $this Fluent Builder + */ + public function setFromDomainSid(string $fromDomainSid): self + { + $this->options['fromDomainSid'] = $fromDomainSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateByocTrunkOptions ' . $options . ']'; + } +} + + + + +class UpdateByocTrunkOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $voiceUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $statusCallbackUrl = Values::NONE, + string $statusCallbackMethod = Values::NONE, + bool $cnamLookupEnabled = Values::BOOL_NONE, + string $connectionPolicySid = Values::NONE, + string $fromDomainSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['connectionPolicySid'] = $connectionPolicySid; + $this->options['fromDomainSid'] = $fromDomainSid; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when the BYOC Trunk receives a call. + * + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url` + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @return $this Fluent Builder + */ + public function setConnectionPolicySid(string $connectionPolicySid): self + { + $this->options['connectionPolicySid'] = $connectionPolicySid; + return $this; + } + + /** + * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * @return $this Fluent Builder + */ + public function setFromDomainSid(string $fromDomainSid): self + { + $this->options['fromDomainSid'] = $fromDomainSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateByocTrunkOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkPage.php new file mode 100644 index 0000000..2e0d6d0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ByocTrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ByocTrunkInstance \Twilio\Rest\Voice\V1\ByocTrunkInstance + */ + public function buildInstance(array $payload): ByocTrunkInstance + { + return new ByocTrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ByocTrunkPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php new file mode 100644 index 0000000..350b9e3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php @@ -0,0 +1,142 @@ +solution = [ + 'connectionPolicySid' => + $connectionPolicySid, + 'sid' => + $sid, + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) + .'/Targets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConnectionPolicyTargetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConnectionPolicyTargetInstance + * + * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyTargetInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectionPolicyTargetInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyTargetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Target' => + $options['target'], + 'Priority' => + $options['priority'], + 'Weight' => + $options['weight'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyTargetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php new file mode 100644 index 0000000..cfda299 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php @@ -0,0 +1,164 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'target' => Values::array_get($payload, 'target'), + 'priority' => Values::array_get($payload, 'priority'), + 'weight' => Values::array_get($payload, 'weight'), + 'enabled' => Values::array_get($payload, 'enabled'), + '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 = ['connectionPolicySid' => $connectionPolicySid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConnectionPolicyTargetContext Context for this ConnectionPolicyTargetInstance + */ + protected function proxy(): ConnectionPolicyTargetContext + { + if (!$this->context) { + $this->context = new ConnectionPolicyTargetContext( + $this->version, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectionPolicyTargetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectionPolicyTargetInstance + * + * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyTargetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectionPolicyTargetInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyTargetInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyTargetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php new file mode 100644 index 0000000..4c13037 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php @@ -0,0 +1,208 @@ +solution = [ + 'connectionPolicySid' => + $connectionPolicySid, + + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) + .'/Targets'; + } + + /** + * Create the ConnectionPolicyTargetInstance + * + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Created ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): ConnectionPolicyTargetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'FriendlyName' => + $options['friendlyName'], + 'Priority' => + $options['priority'], + 'Weight' => + $options['weight'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'] + ); + } + + + /** + * Reads ConnectionPolicyTargetInstance 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 ConnectionPolicyTargetInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConnectionPolicyTargetInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConnectionPolicyTargetInstance 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 ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectionPolicyTargetPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConnectionPolicyTargetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance + */ + public function getPage(string $targetUrl): ConnectionPolicyTargetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectionPolicyTargetContext + * + * @param string $sid The unique string that we created to identify the Target resource to delete. + */ + public function getContext( + string $sid + + ): ConnectionPolicyTargetContext + { + return new ConnectionPolicyTargetContext( + $this->version, + $this->solution['connectionPolicySid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyTargetList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php new file mode 100644 index 0000000..f654186 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php @@ -0,0 +1,260 @@ +options['friendlyName'] = $friendlyName; + $this->options['priority'] = $priority; + $this->options['weight'] = $weight; + $this->options['enabled'] = $enabled; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. + * + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * Whether the Target is enabled. The default is `true`. + * + * @param bool $enabled Whether the Target is enabled. The default is `true`. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateConnectionPolicyTargetOptions ' . $options . ']'; + } +} + + + + +class UpdateConnectionPolicyTargetOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * @param bool $enabled Whether the Target is enabled. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $target = Values::NONE, + int $priority = Values::INT_NONE, + int $weight = Values::INT_NONE, + bool $enabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['target'] = $target; + $this->options['priority'] = $priority; + $this->options['weight'] = $weight; + $this->options['enabled'] = $enabled; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * Whether the Target is enabled. + * + * @param bool $enabled Whether the Target is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateConnectionPolicyTargetOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php new file mode 100644 index 0000000..ef3f4f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectionPolicyTargetInstance \Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetInstance + */ + public function buildInstance(array $payload): ConnectionPolicyTargetInstance + { + return new ConnectionPolicyTargetInstance($this->version, $payload, $this->solution['connectionPolicySid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyTargetPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php new file mode 100644 index 0000000..d569bb0 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php @@ -0,0 +1,184 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConnectionPolicyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConnectionPolicyInstance + * + * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new ConnectionPolicyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConnectionPolicyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the targets + */ + protected function getTargets(): ConnectionPolicyTargetList + { + if (!$this->_targets) { + $this->_targets = new ConnectionPolicyTargetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_targets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php new file mode 100644 index 0000000..a3d8949 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php @@ -0,0 +1,165 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + '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')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConnectionPolicyContext Context for this ConnectionPolicyInstance + */ + protected function proxy(): ConnectionPolicyContext + { + if (!$this->context) { + $this->context = new ConnectionPolicyContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectionPolicyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectionPolicyInstance + * + * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the targets + */ + protected function getTargets(): ConnectionPolicyTargetList + { + return $this->proxy()->targets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyList.php new file mode 100644 index 0000000..922aa27 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyList.php @@ -0,0 +1,190 @@ +solution = [ + ]; + + $this->uri = '/ConnectionPolicies'; + } + + /** + * Create the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Created ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConnectionPolicyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConnectionPolicyInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ConnectionPolicyInstance 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 ConnectionPolicyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConnectionPolicyInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConnectionPolicyInstance 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 ConnectionPolicyPage Page of ConnectionPolicyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectionPolicyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConnectionPolicyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConnectionPolicyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConnectionPolicyPage Page of ConnectionPolicyInstance + */ + public function getPage(string $targetUrl): ConnectionPolicyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectionPolicyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectionPolicyContext + * + * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. + */ + public function getContext( + string $sid + + ): ConnectionPolicyContext + { + return new ConnectionPolicyContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php new file mode 100644 index 0000000..f882272 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php @@ -0,0 +1,134 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateConnectionPolicyOptions ' . $options . ']'; + } +} + + + + +class UpdateConnectionPolicyOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateConnectionPolicyOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php new file mode 100644 index 0000000..4e02850 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectionPolicyInstance \Twilio\Rest\Voice\V1\ConnectionPolicyInstance + */ + public function buildInstance(array $payload): ConnectionPolicyInstance + { + return new ConnectionPolicyInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php new file mode 100644 index 0000000..fd33226 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'updateCount' => Values::array_get($payload, 'update_count'), + 'updateRequest' => Values::array_get($payload, 'update_request'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdateInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php new file mode 100644 index 0000000..543d789 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php @@ -0,0 +1,78 @@ +solution = [ + ]; + + $this->uri = '/DialingPermissions/BulkCountryUpdates'; + } + + /** + * Create the BulkCountryUpdateInstance + * + * @param string $updateRequest URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` + * @return BulkCountryUpdateInstance Created BulkCountryUpdateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $updateRequest): BulkCountryUpdateInstance + { + + $data = Values::of([ + 'UpdateRequest' => + $updateRequest, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BulkCountryUpdateInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdateList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php new file mode 100644 index 0000000..2d871ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BulkCountryUpdateInstance \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateInstance + */ + public function buildInstance(array $payload): BulkCountryUpdateInstance + { + return new BulkCountryUpdateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdatePage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php new file mode 100644 index 0000000..e132f7b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'prefix' => Values::array_get($payload, 'prefix'), + ]; + + $this->solution = ['isoCode' => $isoCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php new file mode 100644 index 0000000..75ca97a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php @@ -0,0 +1,151 @@ +solution = [ + 'isoCode' => + $isoCode, + + ]; + + $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) + .'/HighRiskSpecialPrefixes'; + } + + /** + * Reads HighriskSpecialPrefixInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return HighriskSpecialPrefixInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams HighriskSpecialPrefixInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): HighriskSpecialPrefixPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of HighriskSpecialPrefixInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance + */ + public function getPage(string $targetUrl): HighriskSpecialPrefixPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php new file mode 100644 index 0000000..bf001ac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return HighriskSpecialPrefixInstance \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixInstance + */ + public function buildInstance(array $payload): HighriskSpecialPrefixInstance + { + return new HighriskSpecialPrefixInstance($this->version, $payload, $this->solution['isoCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php new file mode 100644 index 0000000..c087eb5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php @@ -0,0 +1,140 @@ +solution = [ + 'isoCode' => + $isoCode, + ]; + + $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCode'] + ); + } + + + /** + * Access the highriskSpecialPrefixes + */ + protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList + { + if (!$this->_highriskSpecialPrefixes) { + $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( + $this->version, + $this->solution['isoCode'] + ); + } + + return $this->_highriskSpecialPrefixes; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php new file mode 100644 index 0000000..847226f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'isoCode' => Values::array_get($payload, 'iso_code'), + 'name' => Values::array_get($payload, 'name'), + 'continent' => Values::array_get($payload, 'continent'), + 'countryCodes' => Values::array_get($payload, 'country_codes'), + 'lowRiskNumbersEnabled' => Values::array_get($payload, 'low_risk_numbers_enabled'), + 'highRiskSpecialNumbersEnabled' => Values::array_get($payload, 'high_risk_special_numbers_enabled'), + 'highRiskTollfraudNumbersEnabled' => Values::array_get($payload, 'high_risk_tollfraud_numbers_enabled'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['isoCode' => $isoCode ?: $this->properties['isoCode'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCode'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the highriskSpecialPrefixes + */ + protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList + { + return $this->proxy()->highriskSpecialPrefixes; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php new file mode 100644 index 0000000..0e36a04 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/DialingPermissions/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 CountryPage Page of CountryInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + $options = new Values($options); + + $params = Values::of([ + 'IsoCode' => + $options['isoCode'], + 'Continent' => + $options['continent'], + 'CountryCode' => + $options['countryCode'], + 'LowRiskNumbersEnabled' => + Serialize::booleanToString($options['lowRiskNumbersEnabled']), + 'HighRiskSpecialNumbersEnabled' => + Serialize::booleanToString($options['highRiskSpecialNumbersEnabled']), + 'HighRiskTollfraudNumbersEnabled' => + Serialize::booleanToString($options['highRiskTollfraudNumbersEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch + */ + public function getContext( + string $isoCode + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCode + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.CountryList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php new file mode 100644 index 0000000..5922464 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php @@ -0,0 +1,168 @@ +options['isoCode'] = $isoCode; + $this->options['continent'] = $continent; + $this->options['countryCode'] = $countryCode; + $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; + $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; + $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; + } + + /** + * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * + * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * @return $this Fluent Builder + */ + public function setIsoCode(string $isoCode): self + { + $this->options['isoCode'] = $isoCode; + return $this; + } + + /** + * Filter to retrieve the country permissions by specifying the continent + * + * @param string $continent Filter to retrieve the country permissions by specifying the continent + * @return $this Fluent Builder + */ + public function setContinent(string $continent): self + { + $this->options['continent'] = $continent; + return $this; + } + + /** + * Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) + * + * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. + * + * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setLowRiskNumbersEnabled(bool $lowRiskNumbersEnabled): self + { + $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` + * + * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` + * @return $this Fluent Builder + */ + public function setHighRiskSpecialNumbersEnabled(bool $highRiskSpecialNumbersEnabled): self + { + $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. + * + * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setHighRiskTollfraudNumbersEnabled(bool $highRiskTollfraudNumbersEnabled): self + { + $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.ReadCountryOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php new file mode 100644 index 0000000..f587487 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Voice\V1\DialingPermissions\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.CountryPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php new file mode 100644 index 0000000..52ab2b2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php @@ -0,0 +1,106 @@ +solution = [ + ]; + + $this->uri = '/Settings'; + } + + /** + * Fetch the SettingsInstance + * + * @return SettingsInstance Fetched SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SettingsInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Update the SettingsInstance + * + * @param array|Options $options Optional Arguments + * @return SettingsInstance Updated SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DialingPermissionsInheritance' => + Serialize::booleanToString($options['dialingPermissionsInheritance']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php new file mode 100644 index 0000000..f466144 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'dialingPermissionsInheritance' => Values::array_get($payload, 'dialing_permissions_inheritance'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SettingsContext Context for this SettingsInstance + */ + protected function proxy(): SettingsContext + { + if (!$this->context) { + $this->context = new SettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the SettingsInstance + * + * @return SettingsInstance Fetched SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SettingsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SettingsInstance + * + * @param array|Options $options Optional Arguments + * @return SettingsInstance Updated SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingsInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php new file mode 100644 index 0000000..d5468f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SettingsContext + */ + public function getContext( + + ): SettingsContext + { + return new SettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SettingsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php new file mode 100644 index 0000000..4941eff --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php @@ -0,0 +1,78 @@ +options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; + } + + /** + * `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. + * + * @param bool $dialingPermissionsInheritance `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. + * @return $this Fluent Builder + */ + public function setDialingPermissionsInheritance(bool $dialingPermissionsInheritance): self + { + $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateSettingsOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php new file mode 100644 index 0000000..1288c76 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingsInstance \Twilio\Rest\Voice\V1\DialingPermissions\SettingsInstance + */ + public function buildInstance(array $payload): SettingsInstance + { + return new SettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SettingsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php new file mode 100644 index 0000000..5611949 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.DialingPermissionsInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php new file mode 100644 index 0000000..216810d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php @@ -0,0 +1,139 @@ +solution = [ + ]; + } + + /** + * Access the bulkCountryUpdates + */ + protected function getBulkCountryUpdates(): BulkCountryUpdateList + { + if (!$this->_bulkCountryUpdates) { + $this->_bulkCountryUpdates = new BulkCountryUpdateList( + $this->version + ); + } + return $this->_bulkCountryUpdates; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the settings + */ + protected function getSettings(): SettingsList + { + if (!$this->_settings) { + $this->_settings = new SettingsList( + $this->version + ); + } + return $this->_settings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Voice.V1.DialingPermissionsList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php new file mode 100644 index 0000000..9e2f57c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DialingPermissionsInstance \Twilio\Rest\Voice\V1\DialingPermissionsInstance + */ + public function buildInstance(array $payload): DialingPermissionsInstance + { + return new DialingPermissionsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.DialingPermissionsPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordContext.php new file mode 100644 index 0000000..4ee636e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/IpRecords/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the IpRecordInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the IpRecordInstance + * + * @return IpRecordInstance Fetched IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpRecordInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new IpRecordInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the IpRecordInstance + * + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Updated IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpRecordInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new IpRecordInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.IpRecordContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordInstance.php new file mode 100644 index 0000000..6d29d48 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_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'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpRecordContext Context for this IpRecordInstance + */ + protected function proxy(): IpRecordContext + { + if (!$this->context) { + $this->context = new IpRecordContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpRecordInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpRecordInstance + * + * @return IpRecordInstance Fetched IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpRecordInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpRecordInstance + * + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Updated IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpRecordInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.IpRecordInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordList.php new file mode 100644 index 0000000..4195f31 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordList.php @@ -0,0 +1,195 @@ +solution = [ + ]; + + $this->uri = '/IpRecords'; + } + + /** + * Create the IpRecordInstance + * + * @param string $ipAddress An IP address in dotted decimal notation, IPv4 only. + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Created IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAddress, array $options = []): IpRecordInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IpAddress' => + $ipAddress, + 'FriendlyName' => + $options['friendlyName'], + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new IpRecordInstance( + $this->version, + $payload + ); + } + + + /** + * Reads IpRecordInstance 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 IpRecordInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpRecordInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpRecordInstance 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 IpRecordPage Page of IpRecordInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpRecordPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpRecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpRecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpRecordPage Page of IpRecordInstance + */ + public function getPage(string $targetUrl): IpRecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpRecordPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpRecordContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. + */ + public function getContext( + string $sid + + ): IpRecordContext + { + return new IpRecordContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.IpRecordList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordOptions.php new file mode 100644 index 0000000..bcaae2e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. + * + * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateIpRecordOptions ' . $options . ']'; + } +} + + + + +class UpdateIpRecordOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateIpRecordOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordPage.php new file mode 100644 index 0000000..c9ec6ef --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/IpRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpRecordInstance \Twilio\Rest\Voice\V1\IpRecordInstance + */ + public function buildInstance(array $payload): IpRecordInstance + { + return new IpRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.IpRecordPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php new file mode 100644 index 0000000..ca12396 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php @@ -0,0 +1,123 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SourceIpMappings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SourceIpMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SourceIpMappingInstance + * + * @return SourceIpMappingInstance Fetched SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SourceIpMappingInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SourceIpMappingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SourceIpMappingInstance + * + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Updated SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $sipDomainSid): SourceIpMappingInstance + { + + $data = Values::of([ + 'SipDomainSid' => + $sipDomainSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SourceIpMappingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SourceIpMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php new file mode 100644 index 0000000..67345f7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'ipRecordSid' => Values::array_get($payload, 'ip_record_sid'), + 'sipDomainSid' => Values::array_get($payload, 'sip_domain_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SourceIpMappingContext Context for this SourceIpMappingInstance + */ + protected function proxy(): SourceIpMappingContext + { + if (!$this->context) { + $this->context = new SourceIpMappingContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SourceIpMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SourceIpMappingInstance + * + * @return SourceIpMappingInstance Fetched SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SourceIpMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SourceIpMappingInstance + * + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Updated SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $sipDomainSid): SourceIpMappingInstance + { + + return $this->proxy()->update($sipDomainSid); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SourceIpMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingList.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingList.php new file mode 100644 index 0000000..79d8a4c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingList.php @@ -0,0 +1,190 @@ +solution = [ + ]; + + $this->uri = '/SourceIpMappings'; + } + + /** + * Create the SourceIpMappingInstance + * + * @param string $ipRecordSid The Twilio-provided string that uniquely identifies the IP Record resource to map from. + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Created SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipRecordSid, string $sipDomainSid): SourceIpMappingInstance + { + + $data = Values::of([ + 'IpRecordSid' => + $ipRecordSid, + 'SipDomainSid' => + $sipDomainSid, + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new SourceIpMappingInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SourceIpMappingInstance 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 SourceIpMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SourceIpMappingInstance records from the API as a generator stream. + * This operation lazily loads 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SourceIpMappingInstance 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 SourceIpMappingPage Page of SourceIpMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SourceIpMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SourceIpMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SourceIpMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SourceIpMappingPage Page of SourceIpMappingInstance + */ + public function getPage(string $targetUrl): SourceIpMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SourceIpMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SourceIpMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. + */ + public function getContext( + string $sid + + ): SourceIpMappingContext + { + return new SourceIpMappingContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SourceIpMappingList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingPage.php new file mode 100644 index 0000000..0b05367 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SourceIpMappingInstance \Twilio\Rest\Voice\V1\SourceIpMappingInstance + */ + public function buildInstance(array $payload): SourceIpMappingInstance + { + return new SourceIpMappingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SourceIpMappingPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/VoiceBase.php b/vendor/twilio/sdk/src/Twilio/Rest/VoiceBase.php new file mode 100644 index 0000000..a0072ab --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/VoiceBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://voice.twilio.com'; + } + + + /** + * @return V1 Version v1 of voice + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Voice]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless.php new file mode 100644 index 0000000..4fe589a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless.php @@ -0,0 +1,67 @@ +usageRecords instead. + */ + protected function getUsageRecords(): \Twilio\Rest\Wireless\V1\UsageRecordList { + echo "usageRecords is deprecated. Use v1->usageRecords instead."; + return $this->v1->usageRecords; + } + + /** + * @deprecated Use v1->commands instead. + */ + protected function getCommands(): \Twilio\Rest\Wireless\V1\CommandList { + echo "commands is deprecated. Use v1->commands instead."; + return $this->v1->commands; + } + + /** + * @deprecated Use v1->commands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCommands(string $sid): \Twilio\Rest\Wireless\V1\CommandContext { + echo "commands(\$sid) is deprecated. Use v1->commands(\$sid) instead."; + return $this->v1->commands($sid); + } + + /** + * @deprecated Use v1->ratePlans instead. + */ + protected function getRatePlans(): \Twilio\Rest\Wireless\V1\RatePlanList { + echo "ratePlans is deprecated. Use v1->ratePlans instead."; + return $this->v1->ratePlans; + } + + /** + * @deprecated Use v1->ratePlans(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRatePlans(string $sid): \Twilio\Rest\Wireless\V1\RatePlanContext { + echo "ratePlans(\$sid) is deprecated. Use v1->ratePlans(\$sid) instead."; + return $this->v1->ratePlans($sid); + } + + /** + * @deprecated Use v1->sims instead. + */ + protected function getSims(): \Twilio\Rest\Wireless\V1\SimList { + echo "sims is deprecated. Use v1->sims instead."; + return $this->v1->sims; + } + + /** + * @deprecated Use v1->sims(\$sid) instead. + * @param string $sid The SID of the Sim resource to fetch + */ + protected function contextSims(string $sid): \Twilio\Rest\Wireless\V1\SimContext { + echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; + return $this->v1->sims($sid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1.php new file mode 100644 index 0000000..543d6e9 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1.php @@ -0,0 +1,130 @@ +version = 'v1'; + } + + protected function getCommands(): CommandList + { + if (!$this->_commands) { + $this->_commands = new CommandList($this); + } + return $this->_commands; + } + + protected function getRatePlans(): RatePlanList + { + if (!$this->_ratePlans) { + $this->_ratePlans = new RatePlanList($this); + } + return $this->_ratePlans; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList($this); + } + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + return '[Twilio.Wireless.V1]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php new file mode 100644 index 0000000..ff38b93 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php @@ -0,0 +1,97 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Commands/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CommandInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new CommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.CommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php new file mode 100644 index 0000000..be5ecb2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'command' => Values::array_get($payload, 'command'), + 'commandMode' => Values::array_get($payload, 'command_mode'), + 'transport' => Values::array_get($payload, 'transport'), + 'deliveryReceiptRequested' => Values::array_get($payload, 'delivery_receipt_requested'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CommandContext Context for this CommandInstance + */ + protected function proxy(): CommandContext + { + if (!$this->context) { + $this->context = new CommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CommandInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.CommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandList.php new file mode 100644 index 0000000..0e1be9d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandList.php @@ -0,0 +1,216 @@ +solution = [ + ]; + + $this->uri = '/Commands'; + } + + /** + * Create the CommandInstance + * + * @param string $command The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. + * @param array|Options $options Optional Arguments + * @return CommandInstance Created CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $command, array $options = []): CommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Command' => + $command, + 'Sim' => + $options['sim'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CommandMode' => + $options['commandMode'], + 'IncludeSid' => + $options['includeSid'], + 'DeliveryReceiptRequested' => + Serialize::booleanToString($options['deliveryReceiptRequested']), + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new CommandInstance( + $this->version, + $payload + ); + } + + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CommandInstance 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 CommandPage Page of CommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'Transport' => + $options['transport'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CommandPage Page of CommandInstance + */ + public function getPage(string $targetUrl): CommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CommandContext + * + * @param string $sid The SID of the Command resource to delete. + */ + public function getContext( + string $sid + + ): CommandContext + { + return new CommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.CommandList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php new file mode 100644 index 0000000..ca24135 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php @@ -0,0 +1,274 @@ +options['sim'] = $sim; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['commandMode'] = $commandMode; + $this->options['includeSid'] = $includeSid; + $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; + } + + /** + * The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. + * + * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. + * + * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $commandMode + * @return $this Fluent Builder + */ + public function setCommandMode(string $commandMode): self + { + $this->options['commandMode'] = $commandMode; + return $this; + } + + /** + * Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. + * + * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. + * @return $this Fluent Builder + */ + public function setIncludeSid(string $includeSid): self + { + $this->options['includeSid'] = $includeSid; + return $this; + } + + /** + * Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. + * + * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. + * @return $this Fluent Builder + */ + public function setDeliveryReceiptRequested(bool $deliveryReceiptRequested): self + { + $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.CreateCommandOptions ' . $options . ']'; + } +} + + + +class ReadCommandOptions extends Options + { + /** + * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. + * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * @param string $direction Only return Commands with this direction value. + * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. + */ + public function __construct( + + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE, + string $transport = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + $this->options['transport'] = $transport; + } + + /** + * The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. + * + * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * + * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only return Commands with this direction value. + * + * @param string $direction Only return Commands with this direction value. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Only return Commands with this transport value. Can be: `sms` or `ip`. + * + * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. + * @return $this Fluent Builder + */ + public function setTransport(string $transport): self + { + $this->options['transport'] = $transport; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadCommandOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php new file mode 100644 index 0000000..daf0a9e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CommandInstance \Twilio\Rest\Wireless\V1\CommandInstance + */ + public function buildInstance(array $payload): CommandInstance + { + return new CommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.CommandPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php new file mode 100644 index 0000000..a96df41 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php @@ -0,0 +1,128 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RatePlans/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.RatePlanContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php new file mode 100644 index 0000000..212fe40 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php @@ -0,0 +1,172 @@ +properties = [ + '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 = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RatePlanContext Context for this RatePlanInstance + */ + protected function proxy(): RatePlanContext + { + if (!$this->context) { + $this->context = new RatePlanContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + 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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.RatePlanInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php new file mode 100644 index 0000000..72f4ba7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php @@ -0,0 +1,211 @@ +solution = [ + ]; + + $this->uri = '/RatePlans'; + } + + /** + * Create the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Created RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + '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'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new RatePlanInstance( + $this->version, + $payload + ); + } + + + /** + * 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * 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 RatePlanPage Page of RatePlanInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RatePlanPage + { + + $params = Values::of([ + '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 RatePlanPage Page of RatePlanInstance + */ + public function getPage(string $targetUrl): RatePlanPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RatePlanContext + * + * @param string $sid The SID of the RatePlan resource to delete. + */ + public function getContext( + string $sid + + ): RatePlanContext + { + return new RatePlanContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.RatePlanList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php new file mode 100644 index 0000000..4eaa330 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php @@ -0,0 +1,332 @@ +options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['dataEnabled'] = $dataEnabled; + $this->options['dataLimit'] = $dataLimit; + $this->options['dataMetering'] = $dataMetering; + $this->options['messagingEnabled'] = $messagingEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + $this->options['internationalRoaming'] = $internationalRoaming; + $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; + $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It does not have to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. + * + * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). + * + * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). + * @return $this Fluent Builder + */ + public function setDataMetering(string $dataMetering): self + { + $this->options['dataMetering'] = $dataMetering; + return $this; + } + + /** + * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). + * + * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). + * @return $this Fluent Builder + */ + public function setMessagingEnabled(bool $messagingEnabled): self + { + $this->options['messagingEnabled'] = $messagingEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param bool $voiceEnabled Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). + * + * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). + * @return $this Fluent Builder + */ + public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self + { + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + return $this; + } + + /** + * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. + * + * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. + * @return $this Fluent Builder + */ + public function setInternationalRoaming(array $internationalRoaming): self + { + $this->options['internationalRoaming'] = $internationalRoaming; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. + * + * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. + * @return $this Fluent Builder + */ + public function setNationalRoamingDataLimit(int $nationalRoamingDataLimit): self + { + $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + * + * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + * @return $this Fluent Builder + */ + public function setInternationalRoamingDataLimit(int $internationalRoamingDataLimit): self + { + $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.CreateRatePlanOptions ' . $options . ']'; + } +} + + + + +class UpdateRatePlanOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It does not have to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.UpdateRatePlanOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php new file mode 100644 index 0000000..82583bb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RatePlanInstance \Twilio\Rest\Wireless\V1\RatePlanInstance + */ + public function buildInstance(array $payload): RatePlanInstance + { + return new RatePlanInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.RatePlanPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php new file mode 100644 index 0000000..aa7342e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php @@ -0,0 +1,112 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'radioLink' => Values::array_get($payload, 'radio_link'), + 'operatorMcc' => Values::array_get($payload, 'operator_mcc'), + 'operatorMnc' => Values::array_get($payload, 'operator_mnc'), + 'operatorCountry' => Values::array_get($payload, 'operator_country'), + 'operatorName' => Values::array_get($payload, 'operator_name'), + 'cellId' => Values::array_get($payload, 'cell_id'), + 'cellLocationEstimate' => Values::array_get($payload, 'cell_location_estimate'), + 'packetsUploaded' => Values::array_get($payload, 'packets_uploaded'), + 'packetsDownloaded' => Values::array_get($payload, 'packets_downloaded'), + 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), + 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), + 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), + 'imei' => Values::array_get($payload, 'imei'), + ]; + + $this->solution = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.DataSessionInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php new file mode 100644 index 0000000..39292c8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/DataSessions'; + } + + /** + * 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 int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined 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(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * 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 int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DataSessionInstance 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 DataSessionPage Page of DataSessionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DataSessionPage + { + + $params = Values::of([ + '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 DataSessionPage Page of DataSessionInstance + */ + public function getPage(string $targetUrl): DataSessionPage + { + $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(): string + { + return '[Twilio.Wireless.V1.DataSessionList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php new file mode 100644 index 0000000..ac8cb5e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DataSessionInstance \Twilio\Rest\Wireless\V1\Sim\DataSessionInstance + */ + public function buildInstance(array $payload): DataSessionInstance + { + return new DataSessionInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.DataSessionPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php new file mode 100644 index 0000000..2ca9eaf --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php @@ -0,0 +1,89 @@ +properties = [ + '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 = ['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(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php new file mode 100644 index 0000000..a24ec3b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php @@ -0,0 +1,163 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/UsageRecords'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance 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 UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + '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 UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $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(): string + { + return '[Twilio.Wireless.V1.UsageRecordList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php new file mode 100644 index 0000000..e52239c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php @@ -0,0 +1,112 @@ +options['end'] = $end; + $this->options['start'] = $start; + $this->options['granularity'] = $granularity; + } + + /** + * Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. + * + * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. + * @return $this Fluent Builder + */ + public function setEnd(\DateTime $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. + * + * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. + * @return $this Fluent Builder + */ + public function setStart(\DateTime $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * + * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php new file mode 100644 index 0000000..5050318 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\Sim\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimContext.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimContext.php new file mode 100644 index 0000000..2d9f483 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimContext.php @@ -0,0 +1,235 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SimInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'RatePlan' => + $options['ratePlan'], + 'Status' => + $options['status'], + 'CommandsCallbackMethod' => + $options['commandsCallbackMethod'], + 'CommandsCallbackUrl' => + $options['commandsCallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'ResetStatus' => + $options['resetStatus'], + 'AccountSid' => + $options['accountSid'], + ]); + + $headers = Values::of(['Content-Type' => 'application/x-www-form-urlencoded' ]); + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the dataSessions + */ + protected function getDataSessions(): DataSessionList + { + if (!$this->_dataSessions) { + $this->_dataSessions = new DataSessionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_dataSessions; + } + + /** + * Access the usageRecords + */ + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + 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 InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $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(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php new file mode 100644 index 0000000..ed4257f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php @@ -0,0 +1,209 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'eId' => Values::array_get($payload, 'e_id'), + 'status' => Values::array_get($payload, 'status'), + 'resetStatus' => Values::array_get($payload, 'reset_status'), + 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), + 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SimInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dataSessions + */ + protected function getDataSessions(): DataSessionList + { + return $this->proxy()->dataSessions; + } + + /** + * Access the usageRecords + */ + protected function getUsageRecords(): UsageRecordList + { + return $this->proxy()->usageRecords; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimList.php new file mode 100644 index 0000000..b6be5ba --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimList.php @@ -0,0 +1,176 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance 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 SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + '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 SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid The SID or the `unique_name` of the Sim resource to delete. + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.SimList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php new file mode 100644 index 0000000..c00a596 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php @@ -0,0 +1,506 @@ +options['status'] = $status; + $this->options['iccid'] = $iccid; + $this->options['ratePlan'] = $ratePlan; + $this->options['eId'] = $eId; + $this->options['simRegistrationCode'] = $simRegistrationCode; + } + + /** + * Only return Sim resources with this status. + * + * @param string $status Only return Sim resources with this status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. + * + * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. + * + * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * Deprecated. + * + * @param string $eId Deprecated. + * @return $this Fluent Builder + */ + public function setEId(string $eId): self + { + $this->options['eId'] = $eId; + return $this; + } + + /** + * Only return Sim resources with this registration code. This will return a list with a maximum size of 1. + * + * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. + * @return $this Fluent Builder + */ + public function setSimRegistrationCode(string $simRegistrationCode): self + { + $this->options['simRegistrationCode'] = $simRegistrationCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * @param string $status + * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). + * @param string $voiceFallbackMethod Deprecated. + * @param string $voiceFallbackUrl Deprecated. + * @param string $voiceMethod Deprecated. + * @param string $voiceUrl Deprecated. + * @param string $resetStatus + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE, + string $ratePlan = Values::NONE, + string $status = Values::NONE, + string $commandsCallbackMethod = Values::NONE, + string $commandsCallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceUrl = Values::NONE, + string $resetStatus = Values::NONE, + string $accountSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['ratePlan'] = $ratePlan; + $this->options['status'] = $status; + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['resetStatus'] = $resetStatus; + $this->options['accountSid'] = $accountSid; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * + * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * + * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * + * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @return $this Fluent Builder + */ + public function setCommandsCallbackMethod(string $commandsCallbackMethod): self + { + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * + * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * @return $this Fluent Builder + */ + public function setCommandsCallbackUrl(string $commandsCallbackUrl): self + { + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * + * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). + * + * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceFallbackMethod Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceFallbackUrl Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceMethod Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceUrl Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $resetStatus + * @return $this Fluent Builder + */ + public function setResetStatus(string $resetStatus): self + { + $this->options['resetStatus'] = $resetStatus; + return $this; + } + + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). + * + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimPage.php new file mode 100644 index 0000000..deca42b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Wireless\V1\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.SimPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php new file mode 100644 index 0000000..4a7e73e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php @@ -0,0 +1,86 @@ +properties = [ + '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 = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordInstance]'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php new file mode 100644 index 0000000..fc41a71 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php @@ -0,0 +1,157 @@ +solution = [ + ]; + + $this->uri = '/UsageRecords'; + } + + /** + * 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(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * 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 Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance 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 UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + '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 UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $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(): string + { + return '[Twilio.Wireless.V1.UsageRecordList]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php new file mode 100644 index 0000000..78cd011 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php @@ -0,0 +1,112 @@ +options['end'] = $end; + $this->options['start'] = $start; + $this->options['granularity'] = $granularity; + } + + /** + * Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * + * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * @return $this Fluent Builder + */ + public function setEnd(\DateTime $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * + * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * @return $this Fluent Builder + */ + public function setStart(\DateTime $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * + * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php new file mode 100644 index 0000000..4be4d0b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordPage]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Rest/WirelessBase.php b/vendor/twilio/sdk/src/Twilio/Rest/WirelessBase.php new file mode 100644 index 0000000..55f8c38 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Rest/WirelessBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://wireless.twilio.com'; + } + + + /** + * @return V1 Version v1 of wireless + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Wireless]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Security/RequestValidator.php b/vendor/twilio/sdk/src/Twilio/Security/RequestValidator.php new file mode 100644 index 0000000..91022a5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Security/RequestValidator.php @@ -0,0 +1,172 @@ +validate($_SERVER['HTTP_X_TWILIO_SIGNATURE'], 'https://your-example-url.com/api/route/', $_REQUEST); + * $isFromTwilio // <- if this is true, the request did come from Twilio, if not, it didn't + */ +class RequestValidator { + + /** + * @access private + * @var string The auth token to the Twilio Account + */ + private $authToken; + + /** + * constructor + * @access public + * @param string $authToken the auth token of the Twilio user's account + * Sets the account auth token to be used by the rest of the class + */ + public function __construct(string $authToken) { + $this->authToken = $authToken; + } + + /** + * Creates the actual base64 encoded signature of the sha1 hash of the concatenated URL and your auth token + * + * @param string $url the full URL of the request URL you specify for your phone number or app, from the protocol (https...) through the end of the query string (everything after the ?) + * @param array $data the Twilio parameters the request was made with + * @return string + */ + public function computeSignature(string $url, array $data = []): string { + // sort the array by keys + \ksort($data); + + foreach ($data as $key => $value) { + // convert a single value to an array or remove any duplicates + $valueArray = \is_array($value) ? \array_unique($value) : array($value); + // also sort all the values + \sort($valueArray); + + // append them to the data string with no delimiters + foreach ($valueArray as $item) { + $url .= $key . $item; + } + } + + // sha1 then base64 the url to the auth token and return the base64-ed string + return \base64_encode(\hash_hmac('sha1', $url, $this->authToken, true)); + } + + /** + * Converts the raw binary output to a hexadecimal return + * + * @param string $data + * @return string + */ + public static function computeBodyHash(string $data = ''): string { + return \bin2hex(\hash('sha256', $data, true)); + } + + /** + * The only method the client should be running...takes the Twilio signature, their URL, and the Twilio params and validates the signature + * + * @param string $expectedSignature + * @param string $url + * @param array|string $data + * @return bool + */ + public function validate(string $expectedSignature, string $url, $data = []): bool { + $parsedUrl = \parse_url($url); + + $urlWithPort = self::addPort($parsedUrl); + $urlWithoutPort = self::removePort($parsedUrl); + $validBodyHash = true; // May not receive body hash, so default succeed + + if (!\is_array($data)) { + // handling if the data was passed through as a string instead of an array of params + $queryString = \explode('?', $url); + $queryString = $queryString[1]; + \parse_str($queryString, $params); + + $validBodyHash = self::compare(self::computeBodyHash($data), Values::array_get($params, 'bodySHA256')); + $data = []; + } + + /* + * Check signature of the URL with and without port information + * since sig generation on the back end is inconsistent. + */ + $validSignatureWithPort = self::compare( + $expectedSignature, + $this->computeSignature($urlWithPort, $data) + ); + $validSignatureWithoutPort = self::compare( + $expectedSignature, + $this->computeSignature($urlWithoutPort, $data) + ); + + return $validBodyHash && ($validSignatureWithPort || $validSignatureWithoutPort); + } + + /** + * Time insensitive compare, function's runtime is governed by the length + * of the first argument, not the difference between the arguments. + * + * @param string $a First part of the comparison pair + * @param string $b Second part of the comparison pair + * @return bool True if $a === $b, false otherwise. + */ + public static function compare(?string $a, ?string $b): bool { + if ($a && $b) { + return hash_equals($a, $b); + } + + return false; + } + + /** + * Removes the port from the URL + * + * @param array $parsedUrl + * @return string Full URL without the port number + */ + private static function removePort(array $parsedUrl): string { + unset($parsedUrl['port']); + return self::unparse_url($parsedUrl); + } + + /** + * Adds the port to the URL + * + * @param array $parsedUrl + * @return string Full URL with the port number + */ + private static function addPort(array $parsedUrl): string { + if (!isset($parsedUrl['port'])) { + $port = ($parsedUrl['scheme'] === 'https') ? 443 : 80; + $parsedUrl['port'] = $port; + } + return self::unparse_url($parsedUrl); + } + + /** + * Builds the URL from its parsed component pieces + * + * @param array $parsedUrl + * @return string Full URL + */ + static function unparse_url(array $parsedUrl): string { + $parts = []; + + $parts['scheme'] = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] . '://' : ''; + $parts['user'] = $parsedUrl['user'] ?? ''; + $parts['pass'] = isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : ''; + $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; + $parts['host'] = $parsedUrl['host'] ?? ''; + $parts['port'] = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : ''; + $parts['path'] = $parsedUrl['path'] ?? ''; + $parts['query'] = isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : ''; + $parts['fragment'] = isset($parsedUrl['fragment']) ? '#' . $parsedUrl['fragment'] : ''; + + return \implode('', $parts); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Serialize.php b/vendor/twilio/sdk/src/Twilio/Serialize.php new file mode 100644 index 0000000..e40fa2a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Serialize.php @@ -0,0 +1,83 @@ + $value) { + if (\is_array($value)) { + $result = self::flatten($value, $result, \array_merge($previous, [$key])); + } else { + $result[\implode('.', \array_merge($previous, [$key]))] = $value; + } + } + + return $result; + } + + public static function prefixedCollapsibleMap($map, string $prefix): array { + if ($map === null || $map === Values::NONE) { + return []; + } + + $flattened = self::flatten($map); + $result = []; + foreach ($flattened as $key => $value) { + $result[$prefix . '.' . $key] = $value; + } + + return $result; + } + + public static function iso8601Date($dateTime): string { + if ($dateTime === null || $dateTime === Values::NONE) { + return Values::NONE; + } + + if (\is_string($dateTime)) { + return $dateTime; + } + + $utcDate = clone $dateTime; + $utcDate->setTimezone(new \DateTimeZone('+0000')); + return $utcDate->format('Y-m-d'); + } + + public static function iso8601DateTime($dateTime): string { + if ($dateTime === null || $dateTime === Values::NONE) { + return Values::NONE; + } + + if (\is_string($dateTime)) { + return $dateTime; + } + + $utcDate = clone $dateTime; + $utcDate->setTimezone(new \DateTimeZone('+0000')); + return $utcDate->format('Y-m-d\TH:i:s\Z'); + } + + public static function booleanToString($boolOrStr) { + if ($boolOrStr === null || \is_string($boolOrStr)) { + return $boolOrStr; + } + + return $boolOrStr ? 'true' : 'false'; + } + + 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); + } + +} diff --git a/vendor/twilio/sdk/src/Twilio/Stream.php b/vendor/twilio/sdk/src/Twilio/Stream.php new file mode 100644 index 0000000..a9d1cdb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Stream.php @@ -0,0 +1,105 @@ +page = $page; + $this->firstPage = $page; + $this->limit = $limit; + $this->currentRecord = 1; + $this->pageLimit = $pageLimit; + $this->currentPage = 1; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Return the current element + * @link http://php.net/manual/en/iterator.current.php + * @return mixed Can return any type. + */ + #[\ReturnTypeWillChange] + public function current() { + return $this->page->current(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Move forward to next element + * @link http://php.net/manual/en/iterator.next.php + * @return void Any returned value is ignored. + */ + public function next(): void { + $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)
+ * 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. + */ + #[\ReturnTypeWillChange] + public function key() { + return $this->currentRecord; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid + * @link http://php.net/manual/en/iterator.valid.php + * @return bool The return value will be casted to boolean and then evaluated. + * Returns true on success or false on failure. + */ + public function valid(): bool { + return $this->page && $this->page->valid() && !$this->overLimit() && !$this->overPageLimit(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * 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(): void { + $this->page = $this->firstPage; + $this->page->rewind(); + $this->currentPage = 1; + $this->currentRecord = 1; + } + + protected function overLimit(): bool { + return ($this->limit !== null + && $this->limit !== Values::NONE + && $this->limit < $this->currentRecord); + } + + protected function overPageLimit(): bool { + return ($this->pageLimit !== null + && $this->pageLimit !== Values::NONE + && $this->pageLimit < $this->currentPage); + } + +} diff --git a/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowConfiguration.php b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowConfiguration.php new file mode 100644 index 0000000..13a9d8e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowConfiguration.php @@ -0,0 +1,49 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowConfiguration implements \JsonSerializable { + public $filters; + public $default_filter; + + public function __construct(array $filters, $default_filter = null) { + $this->filters = $filters; + $this->default_filter = $default_filter; + } + + public function toJSON() { + return \json_encode($this); + } + + public static function parse(string $json) { + return \json_decode($json); + } + + public static function fromJson(string $json): WorkflowConfiguration { + $configJSON = self::parse($json); + $default_filter = $configJSON->task_routing->default_filter; + $filters = []; + foreach ($configJSON->task_routing->filters as $filter) { + // friendly_name and filter_friendly_name should map to same variable + $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(): array { + $json = []; + $task_routing = []; + $task_routing['filters'] = $this->filters; + $task_routing['default_filter'] = $this->default_filter; + $json['task_routing'] = $task_routing; + return $json; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRule.php b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRule.php new file mode 100644 index 0000000..0183882 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRule.php @@ -0,0 +1,31 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowRule implements \JsonSerializable { + public $expression; + public $friendly_name; + public $targets; + + public function __construct(string $expression, array $targets, string $friendly_name = null) { + $this->expression = $expression; + $this->targets = $targets; + $this->friendly_name = $friendly_name; + } + + public function jsonSerialize(): array { + $json = []; + $json['expression'] = $this->expression; + $json['targets'] = $this->targets; + if ($this->friendly_name !== null) { + $json['friendly_name'] = $this->friendly_name; + } + return $json; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRuleTarget.php b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRuleTarget.php new file mode 100644 index 0000000..c84fbbc --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TaskRouter/WorkflowRuleTarget.php @@ -0,0 +1,38 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowRuleTarget implements \JsonSerializable { + public $queue; + public $expression; + public $priority; + public $timeout; + + public function __construct(string $queue, int $priority = null, int $timeout = null, string $expression = null) { + $this->queue = $queue; + $this->priority = $priority; + $this->timeout = $timeout; + $this->expression = $expression; + } + + public function jsonSerialize(): array { + $json = []; + $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; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Fax/Receive.php b/vendor/twilio/sdk/src/Twilio/TwiML/Fax/Receive.php new file mode 100644 index 0000000..0a98e6f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Fax/Receive.php @@ -0,0 +1,70 @@ +setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Receive action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add MediaType attribute. + * + * @param string $mediaType The media type used to store media in the fax media + * store + */ + public function setMediaType($mediaType): self { + return $this->setAttribute('mediaType', $mediaType); + } + + /** + * Add PageSize attribute. + * + * @param string $pageSize What size to interpret received pages as + */ + public function setPageSize($pageSize): self { + return $this->setAttribute('pageSize', $pageSize); + } + + /** + * Add StoreMedia attribute. + * + * @param bool $storeMedia Whether or not to store received media in the fax + * media store + */ + public function setStoreMedia($storeMedia): self { + return $this->setAttribute('storeMedia', $storeMedia); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/FaxResponse.php b/vendor/twilio/sdk/src/Twilio/TwiML/FaxResponse.php new file mode 100644 index 0000000..7d9ba75 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/FaxResponse.php @@ -0,0 +1,29 @@ +nest(new Fax\Receive($attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/GenericNode.php b/vendor/twilio/sdk/src/Twilio/TwiML/GenericNode.php new file mode 100644 index 0000000..6eead6c --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/GenericNode.php @@ -0,0 +1,19 @@ +name = $name; + $this->value = $value; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Body.php b/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Body.php new file mode 100644 index 0000000..a147e73 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Body.php @@ -0,0 +1,23 @@ +nest(new Body($message)); + } + + /** + * Add Media child. + * + * @param string $url Media URL + * @return Media Child element. + */ + public function media($url): Media { + return $this->nest(new Media($url)); + } + + /** + * Add To attribute. + * + * @param string $to Phone Number to send Message to + */ + public function setTo($to): self { + return $this->setAttribute('to', $to); + } + + /** + * Add From attribute. + * + * @param string $from Phone Number to send Message from + */ + public function setFrom($from): self { + return $this->setAttribute('from', $from); + } + + /** + * Add Action attribute. + * + * @param string $action A URL specifying where Twilio should send status + * callbacks for the created outbound message. + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL. Deprecated in favor of + * action. + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Redirect.php b/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Redirect.php new file mode 100644 index 0000000..9781a96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Messaging/Redirect.php @@ -0,0 +1,33 @@ +setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/MessagingResponse.php b/vendor/twilio/sdk/src/Twilio/TwiML/MessagingResponse.php new file mode 100644 index 0000000..ee9a113 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/MessagingResponse.php @@ -0,0 +1,41 @@ +nest(new Messaging\Message($body, $attributes)); + } + + /** + * Add Redirect child. + * + * @param string $url Redirect URL + * @param array $attributes Optional attributes + * @return Messaging\Redirect Child element. + */ + public function redirect($url, $attributes = []): Messaging\Redirect { + return $this->nest(new Messaging\Redirect($url, $attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/TwiML.php b/vendor/twilio/sdk/src/Twilio/TwiML/TwiML.php new file mode 100644 index 0000000..6e8ceb4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/TwiML.php @@ -0,0 +1,136 @@ +name = $name; + $this->attributes = $attributes; + $this->children = []; + + if ($value !== null) { + $this->children[] = $value; + } + } + + /** + * Add a TwiML element. + * + * @param TwiML|string $twiml TwiML element to add + * @return TwiML $this + */ + public function append($twiml): 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 $twiml): TwiML { + $this->children[] = $twiml; + return $twiml; + } + + /** + * Set TwiML attribute. + * + * @param string $key name of attribute + * @param string $value value of attribute + * @return static $this + */ + public function setAttribute(string $key, string $value): TwiML { + $this->attributes[$key] = $value; + return $this; + } + + /** + * @param string $name XML element name + * @param string $value XML value + * @param array $attributes XML attributes + * @return TwiML + */ + public function addChild(string $name, string $value = null, array $attributes = []): TwiML { + return $this->nest(new GenericNode($name, $value, $attributes)); + } + + /** + * Convert TwiML to XML string. + * + * @return string TwiML XML representation + */ + public function asXML(): string { + return (string)$this; + } + + /** + * Convert TwiML to XML string. + * + * @return string TwiML XML representation + */ + public function __toString(): string { + return $this->xml()->saveXML(); + } + + /** + * Build TwiML element. + * + * @param TwiML $twiml TwiML element to convert to XML + * @param DOMDocument $document XML document for the element + * @return DOMElement $element + */ + private function buildElement(TwiML $twiml, DOMDocument $document): DOMElement { + $element = $document->createElement($twiml->name); + + foreach ($twiml->attributes as $name => $value) { + if (\is_bool($value)) { + $value = ($value === true) ? 'true' : 'false'; + } + $element->setAttribute($name, $value); + } + + foreach ($twiml->children as $child) { + if (\is_string($child)) { + $element->appendChild($document->createTextNode($child)); + } else { + $element->appendChild($this->buildElement($child, $document)); + } + } + + return $element; + } + + /** + * Build XML element. + * + * @return DOMDocument Build TwiML element + */ + private function xml(): DOMDocument { + $document = new DOMDocument('1.0', 'UTF-8'); + $document->appendChild($this->buildElement($this, $document)); + return $document; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Video/Room.php b/vendor/twilio/sdk/src/Twilio/TwiML/Video/Room.php new file mode 100644 index 0000000..2da2520 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Video/Room.php @@ -0,0 +1,23 @@ +nest(new ApplicationSid($sid)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to trigger status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL Method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add CustomerId attribute. + * + * @param string $customerId Identity of the customer calling application + */ + public function setCustomerId($customerId): self { + return $this->setAttribute('customerId', $customerId); + } + + /** + * Add CopyParentTo attribute. + * + * @param bool $copyParentTo Copy parent call To field to called application + * side, otherwise use the application sid as To field + */ + public function setCopyParentTo($copyParentTo): self { + return $this->setAttribute('copyParentTo', $copyParentTo); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ApplicationSid.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ApplicationSid.php new file mode 100644 index 0000000..952e350 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ApplicationSid.php @@ -0,0 +1,23 @@ +nest(new Identity($clientIdentity)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Url attribute. + * + * @param string $url Client URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Client URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to trigger status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL Method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conference.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conference.php new file mode 100644 index 0000000..eb28e72 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conference.php @@ -0,0 +1,206 @@ +setAttribute('muted', $muted); + } + + /** + * Add Beep attribute. + * + * @param string $beep Play beep when joining + */ + public function setBeep($beep): self { + return $this->setAttribute('beep', $beep); + } + + /** + * Add StartConferenceOnEnter attribute. + * + * @param bool $startConferenceOnEnter Start the conference on enter + */ + public function setStartConferenceOnEnter($startConferenceOnEnter): self { + return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); + } + + /** + * Add EndConferenceOnExit attribute. + * + * @param bool $endConferenceOnExit End the conferenceon exit + */ + public function setEndConferenceOnExit($endConferenceOnExit): self { + return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); + } + + /** + * Add WaitUrl attribute. + * + * @param string $waitUrl Wait URL + */ + public function setWaitUrl($waitUrl): self { + return $this->setAttribute('waitUrl', $waitUrl); + } + + /** + * Add WaitMethod attribute. + * + * @param string $waitMethod Wait URL method + */ + public function setWaitMethod($waitMethod): self { + return $this->setAttribute('waitMethod', $waitMethod); + } + + /** + * Add MaxParticipants attribute. + * + * @param int $maxParticipants Maximum number of participants + */ + public function setMaxParticipants($maxParticipants): self { + return $this->setAttribute('maxParticipants', $maxParticipants); + } + + /** + * Add Record attribute. + * + * @param string $record Record the conference + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Region attribute. + * + * @param string $region Conference region + */ + public function setRegion($region): self { + return $this->setAttribute('region', $region); + } + + /** + * Add Coach attribute. + * + * @param string $coach Call coach + */ + public function setCoach($coach): self { + return $this->setAttribute('coach', $coach); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the conference recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback URL + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add EventCallbackUrl attribute. + * + * @param string $eventCallbackUrl Event callback URL + */ + public function setEventCallbackUrl($eventCallbackUrl): self { + return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); + } + + /** + * Add JitterBufferSize attribute. + * + * @param string $jitterBufferSize Size of jitter buffer for participant + */ + public function setJitterBufferSize($jitterBufferSize): self { + return $this->setAttribute('jitterBufferSize', $jitterBufferSize); + } + + /** + * Add ParticipantLabel attribute. + * + * @param string $participantLabel A label for participant + */ + public function setParticipantLabel($participantLabel): self { + return $this->setAttribute('participantLabel', $participantLabel); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Config.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Config.php new file mode 100644 index 0000000..479317e --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Config.php @@ -0,0 +1,41 @@ +setAttribute('name', $name); + } + + /** + * Add Value attribute. + * + * @param string $value The value of the custom config + */ + public function setValue($value): self { + return $this->setAttribute('value', $value); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Connect.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Connect.php new file mode 100644 index 0000000..9f97f54 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Connect.php @@ -0,0 +1,92 @@ +nest(new Room($name, $attributes)); + } + + /** + * Add Autopilot child. + * + * @param string $name Autopilot assistant sid or unique name + * @return Autopilot Child element. + */ + public function autopilot($name): Autopilot { + return $this->nest(new Autopilot($name)); + } + + /** + * Add Stream child. + * + * @param array $attributes Optional attributes + * @return Stream Child element. + */ + public function stream($attributes = []): Stream { + return $this->nest(new Stream($attributes)); + } + + /** + * Add VirtualAgent child. + * + * @param array $attributes Optional attributes + * @return VirtualAgent Child element. + */ + public function virtualAgent($attributes = []): VirtualAgent { + return $this->nest(new VirtualAgent($attributes)); + } + + /** + * Add Conversation child. + * + * @param array $attributes Optional attributes + * @return Conversation Child element. + */ + public function conversation($attributes = []): Conversation { + return $this->nest(new Conversation($attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conversation.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conversation.php new file mode 100644 index 0000000..45c7371 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Conversation.php @@ -0,0 +1,151 @@ +setAttribute('serviceInstanceSid', $serviceInstanceSid); + } + + /** + * Add InboundAutocreation attribute. + * + * @param bool $inboundAutocreation Inbound autocreation + */ + public function setInboundAutocreation($inboundAutocreation): self { + return $this->setAttribute('inboundAutocreation', $inboundAutocreation); + } + + /** + * Add RoutingAssignmentTimeout attribute. + * + * @param int $routingAssignmentTimeout Routing assignment timeout + */ + public function setRoutingAssignmentTimeout($routingAssignmentTimeout): self { + return $this->setAttribute('routingAssignmentTimeout', $routingAssignmentTimeout); + } + + /** + * Add InboundTimeout attribute. + * + * @param int $inboundTimeout Inbound timeout + */ + public function setInboundTimeout($inboundTimeout): self { + return $this->setAttribute('inboundTimeout', $inboundTimeout); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Record attribute. + * + * @param string $record Record + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback URL + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Dial.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Dial.php new file mode 100644 index 0000000..edbadf3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Dial.php @@ -0,0 +1,262 @@ +nest(new Client($identity, $attributes)); + } + + /** + * Add Conference child. + * + * @param string $name Conference name + * @param array $attributes Optional attributes + * @return Conference Child element. + */ + public function conference($name, $attributes = []): Conference { + return $this->nest(new Conference($name, $attributes)); + } + + /** + * Add Number child. + * + * @param string $phoneNumber Phone Number to dial + * @param array $attributes Optional attributes + * @return Number Child element. + */ + public function number($phoneNumber, $attributes = []): Number { + return $this->nest(new Number($phoneNumber, $attributes)); + } + + /** + * Add Queue child. + * + * @param string $name Queue name + * @param array $attributes Optional attributes + * @return Queue Child element. + */ + public function queue($name, $attributes = []): Queue { + return $this->nest(new Queue($name, $attributes)); + } + + /** + * Add Sim child. + * + * @param string $simSid SIM SID + * @return Sim Child element. + */ + public function sim($simSid): Sim { + return $this->nest(new Sim($simSid)); + } + + /** + * Add Sip child. + * + * @param string $sipUrl SIP URL + * @param array $attributes Optional attributes + * @return Sip Child element. + */ + public function sip($sipUrl, $attributes = []): Sip { + return $this->nest(new Sip($sipUrl, $attributes)); + } + + /** + * Add Application child. + * + * @param string $applicationSid Application sid + * @param array $attributes Optional attributes + * @return Application Child element. + */ + public function application($applicationSid = null, $attributes = []): Application { + return $this->nest(new Application($applicationSid, $attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait for answer + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add HangupOnStar attribute. + * + * @param bool $hangupOnStar Hangup call on star press + */ + public function setHangupOnStar($hangupOnStar): self { + return $this->setAttribute('hangupOnStar', $hangupOnStar); + } + + /** + * Add TimeLimit attribute. + * + * @param int $timeLimit Max time length + */ + public function setTimeLimit($timeLimit): self { + return $this->setAttribute('timeLimit', $timeLimit); + } + + /** + * Add CallerId attribute. + * + * @param string $callerId Caller ID to display + */ + public function setCallerId($callerId): self { + return $this->setAttribute('callerId', $callerId); + } + + /** + * Add Record attribute. + * + * @param string $record Record the call + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add AnswerOnBridge attribute. + * + * @param bool $answerOnBridge Preserve the ringing behavior of the inbound + * call until the Dialed call picks up + */ + public function setAnswerOnBridge($answerOnBridge): self { + return $this->setAttribute('answerOnBridge', $answerOnBridge); + } + + /** + * Add RingTone attribute. + * + * @param string $ringTone Ringtone allows you to override the ringback tone + * that Twilio will play back to the caller while + * executing the Dial + */ + public function setRingTone($ringTone): self { + return $this->setAttribute('ringTone', $ringTone); + } + + /** + * Add RecordingTrack attribute. + * + * @param string $recordingTrack To indicate which audio track should be + * recorded + */ + public function setRecordingTrack($recordingTrack): self { + return $this->setAttribute('recordingTrack', $recordingTrack); + } + + /** + * Add Sequential attribute. + * + * @param bool $sequential Used to determine if child TwiML nouns should be + * dialed in order, one after the other (sequential) or + * dial all at once (parallel). Default is false, + * parallel + */ + public function setSequential($sequential): self { + return $this->setAttribute('sequential', $sequential); + } + + /** + * Add ReferUrl attribute. + * + * @param string $referUrl Webhook that will receive future SIP REFER requests + */ + public function setReferUrl($referUrl): self { + return $this->setAttribute('referUrl', $referUrl); + } + + /** + * Add ReferMethod attribute. + * + * @param string $referMethod The HTTP method to use for the refer Webhook + */ + public function setReferMethod($referMethod): self { + return $this->setAttribute('referMethod', $referMethod); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Echo_.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Echo_.php new file mode 100644 index 0000000..abbc66f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Echo_.php @@ -0,0 +1,21 @@ +nest(new Task($body, $attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add MaxQueueSize attribute. + * + * @param int $maxQueueSize Maximum size of queue + */ + public function setMaxQueueSize($maxQueueSize): self { + return $this->setAttribute('maxQueueSize', $maxQueueSize); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add WaitUrl attribute. + * + * @param string $waitUrl Wait URL + */ + public function setWaitUrl($waitUrl): self { + return $this->setAttribute('waitUrl', $waitUrl); + } + + /** + * Add WaitUrlMethod attribute. + * + * @param string $waitUrlMethod Wait URL method + */ + public function setWaitUrlMethod($waitUrlMethod): self { + return $this->setAttribute('waitUrlMethod', $waitUrlMethod); + } + + /** + * Add WorkflowSid attribute. + * + * @param string $workflowSid TaskRouter Workflow SID + */ + public function setWorkflowSid($workflowSid): self { + return $this->setAttribute('workflowSid', $workflowSid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Gather.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Gather.php new file mode 100644 index 0000000..65d96e5 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Gather.php @@ -0,0 +1,220 @@ +nest(new Say($message, $attributes)); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Pause Child element. + */ + public function pause($attributes = []): Pause { + return $this->nest(new Pause($attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Play Child element. + */ + public function play($url = null, $attributes = []): Play { + return $this->nest(new Play($url, $attributes)); + } + + /** + * Add Input attribute. + * + * @param string[] $input Input type Twilio should accept + */ + public function setInput($input): self { + return $this->setAttribute('input', $input); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait to gather input + */ + public function setTimeout($timeout): self { + 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. + */ + public function setSpeechTimeout($speechTimeout): self { + return $this->setAttribute('speechTimeout', $speechTimeout); + } + + /** + * Add MaxSpeechTime attribute. + * + * @param int $maxSpeechTime Max allowed time for speech input + */ + public function setMaxSpeechTime($maxSpeechTime): self { + return $this->setAttribute('maxSpeechTime', $maxSpeechTime); + } + + /** + * Add ProfanityFilter attribute. + * + * @param bool $profanityFilter Profanity Filter on speech + */ + public function setProfanityFilter($profanityFilter): self { + return $this->setAttribute('profanityFilter', $profanityFilter); + } + + /** + * Add FinishOnKey attribute. + * + * @param string $finishOnKey Finish gather on key + */ + public function setFinishOnKey($finishOnKey): self { + return $this->setAttribute('finishOnKey', $finishOnKey); + } + + /** + * Add NumDigits attribute. + * + * @param int $numDigits Number of digits to collect + */ + public function setNumDigits($numDigits): self { + return $this->setAttribute('numDigits', $numDigits); + } + + /** + * Add PartialResultCallback attribute. + * + * @param string $partialResultCallback Partial result callback URL + */ + public function setPartialResultCallback($partialResultCallback): self { + return $this->setAttribute('partialResultCallback', $partialResultCallback); + } + + /** + * Add PartialResultCallbackMethod attribute. + * + * @param string $partialResultCallbackMethod Partial result callback URL method + */ + public function setPartialResultCallbackMethod($partialResultCallbackMethod): self { + return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); + } + + /** + * Add Language attribute. + * + * @param string $language Language to use + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } + + /** + * Add Hints attribute. + * + * @param string $hints Speech recognition hints + */ + public function setHints($hints): self { + return $this->setAttribute('hints', $hints); + } + + /** + * Add BargeIn attribute. + * + * @param bool $bargeIn Stop playing media upon speech + */ + public function setBargeIn($bargeIn): self { + return $this->setAttribute('bargeIn', $bargeIn); + } + + /** + * Add Debug attribute. + * + * @param bool $debug Allow debug for gather + */ + public function setDebug($debug): self { + return $this->setAttribute('debug', $debug); + } + + /** + * Add ActionOnEmptyResult attribute. + * + * @param bool $actionOnEmptyResult Force webhook to the action URL event if + * there is no input + */ + public function setActionOnEmptyResult($actionOnEmptyResult): self { + return $this->setAttribute('actionOnEmptyResult', $actionOnEmptyResult); + } + + /** + * Add SpeechModel attribute. + * + * @param string $speechModel Specify the model that is best suited for your + * use case + */ + public function setSpeechModel($speechModel): self { + return $this->setAttribute('speechModel', $speechModel); + } + + /** + * Add Enhanced attribute. + * + * @param bool $enhanced Use enhanced speech model + */ + public function setEnhanced($enhanced): self { + return $this->setAttribute('enhanced', $enhanced); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Hangup.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Hangup.php new file mode 100644 index 0000000..05271e2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Hangup.php @@ -0,0 +1,31 @@ +nest(new Parameter($attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Identity.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Identity.php new file mode 100644 index 0000000..0bbd224 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Identity.php @@ -0,0 +1,23 @@ +setAttribute('sendDigits', $sendDigits); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add Byoc attribute. + * + * @param string $byoc BYOC trunk SID (Beta) + */ + public function setByoc($byoc): self { + return $this->setAttribute('byoc', $byoc); + } + + /** + * Add MachineDetection attribute. + * + * @param string $machineDetection Enable machine detection or end of greeting + * detection + */ + public function setMachineDetection($machineDetection): self { + return $this->setAttribute('machineDetection', $machineDetection); + } + + /** + * Add AmdStatusCallbackMethod attribute. + * + * @param string $amdStatusCallbackMethod HTTP Method to use with + * amd_status_callback + */ + public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { + return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); + } + + /** + * Add AmdStatusCallback attribute. + * + * @param string $amdStatusCallback The URL we should call to send amd status + * information to your application + */ + public function setAmdStatusCallback($amdStatusCallback): self { + return $this->setAttribute('amdStatusCallback', $amdStatusCallback); + } + + /** + * Add MachineDetectionTimeout attribute. + * + * @param int $machineDetectionTimeout Number of seconds to wait for machine + * detection + */ + public function setMachineDetectionTimeout($machineDetectionTimeout): self { + return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); + } + + /** + * Add MachineDetectionSpeechThreshold attribute. + * + * @param int $machineDetectionSpeechThreshold Number of milliseconds for + * measuring stick for the length + * of the speech activity + */ + public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { + return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); + } + + /** + * Add MachineDetectionSpeechEndThreshold attribute. + * + * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of + * silence after speech activity + */ + public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { + return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); + } + + /** + * Add MachineDetectionSilenceTimeout attribute. + * + * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial + * silence + */ + public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { + return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Parameter.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Parameter.php new file mode 100644 index 0000000..775e329 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Parameter.php @@ -0,0 +1,41 @@ +setAttribute('name', $name); + } + + /** + * Add Value attribute. + * + * @param string $value The value of the custom parameter + */ + public function setValue($value): self { + return $this->setAttribute('value', $value); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pause.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pause.php new file mode 100644 index 0000000..a252b1f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pause.php @@ -0,0 +1,32 @@ +setAttribute('length', $length); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pay.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pay.php new file mode 100644 index 0000000..89d413f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Pay.php @@ -0,0 +1,212 @@ +nest(new Prompt($attributes)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Input attribute. + * + * @param string $input Input type Twilio should accept + */ + public function setInput($input): self { + return $this->setAttribute('input', $input); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add BankAccountType attribute. + * + * @param string $bankAccountType Bank account type for ach transactions. If + * set, payment method attribute must be + * provided and value should be set to + * ach-debit. defaults to consumer-checking + */ + public function setBankAccountType($bankAccountType): self { + return $this->setAttribute('bankAccountType', $bankAccountType); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait to gather input + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add MaxAttempts attribute. + * + * @param int $maxAttempts Maximum number of allowed retries when gathering + * input + */ + public function setMaxAttempts($maxAttempts): self { + return $this->setAttribute('maxAttempts', $maxAttempts); + } + + /** + * Add SecurityCode attribute. + * + * @param bool $securityCode Prompt for security code + */ + public function setSecurityCode($securityCode): self { + return $this->setAttribute('securityCode', $securityCode); + } + + /** + * Add PostalCode attribute. + * + * @param string $postalCode Prompt for postal code and it should be true/false + * or default postal code + */ + public function setPostalCode($postalCode): self { + return $this->setAttribute('postalCode', $postalCode); + } + + /** + * Add MinPostalCodeLength attribute. + * + * @param int $minPostalCodeLength Prompt for minimum postal code length + */ + public function setMinPostalCodeLength($minPostalCodeLength): self { + return $this->setAttribute('minPostalCodeLength', $minPostalCodeLength); + } + + /** + * Add PaymentConnector attribute. + * + * @param string $paymentConnector Unique name for payment connector + */ + public function setPaymentConnector($paymentConnector): self { + return $this->setAttribute('paymentConnector', $paymentConnector); + } + + /** + * Add PaymentMethod attribute. + * + * @param string $paymentMethod Payment method to be used. defaults to + * credit-card + */ + public function setPaymentMethod($paymentMethod): self { + return $this->setAttribute('paymentMethod', $paymentMethod); + } + + /** + * Add TokenType attribute. + * + * @param string $tokenType Type of token + */ + public function setTokenType($tokenType): self { + return $this->setAttribute('tokenType', $tokenType); + } + + /** + * Add ChargeAmount attribute. + * + * @param string $chargeAmount Amount to process. If value is greater than 0 + * then make the payment else create a payment token + */ + public function setChargeAmount($chargeAmount): self { + return $this->setAttribute('chargeAmount', $chargeAmount); + } + + /** + * Add Currency attribute. + * + * @param string $currency Currency of the amount attribute + */ + public function setCurrency($currency): self { + return $this->setAttribute('currency', $currency); + } + + /** + * Add Description attribute. + * + * @param string $description Details regarding the payment + */ + public function setDescription($description): self { + return $this->setAttribute('description', $description); + } + + /** + * Add ValidCardTypes attribute. + * + * @param string[] $validCardTypes Comma separated accepted card types + */ + public function setValidCardTypes($validCardTypes): self { + return $this->setAttribute('validCardTypes', $validCardTypes); + } + + /** + * Add Language attribute. + * + * @param string $language Language to use + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Play.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Play.php new file mode 100644 index 0000000..aeb9917 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Play.php @@ -0,0 +1,42 @@ +setAttribute('loop', $loop); + } + + /** + * Add Digits attribute. + * + * @param string $digits Play DTMF tones for digits + */ + public function setDigits($digits): self { + return $this->setAttribute('digits', $digits); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Prompt.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Prompt.php new file mode 100644 index 0000000..a79edd3 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Prompt.php @@ -0,0 +1,101 @@ +nest(new Say($message, $attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Play Child element. + */ + public function play($url = null, $attributes = []): Play { + return $this->nest(new Play($url, $attributes)); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Pause Child element. + */ + public function pause($attributes = []): Pause { + return $this->nest(new Pause($attributes)); + } + + /** + * Add For_ attribute. + * + * @param string $for_ Name of the payment source data element + */ + public function setFor_($for_): self { + return $this->setAttribute('for_', $for_); + } + + /** + * Add ErrorType attribute. + * + * @param string[] $errorType Type of error + */ + public function setErrorType($errorType): self { + return $this->setAttribute('errorType', $errorType); + } + + /** + * Add CardType attribute. + * + * @param string[] $cardType Type of the credit card + */ + public function setCardType($cardType): self { + return $this->setAttribute('cardType', $cardType); + } + + /** + * Add Attempt attribute. + * + * @param int[] $attempt Current attempt count + */ + public function setAttempt($attempt): self { + return $this->setAttribute('attempt', $attempt); + } + + /** + * Add RequireMatchingInputs attribute. + * + * @param bool $requireMatchingInputs Require customer to input requested + * information twice and verify matching. + */ + public function setRequireMatchingInputs($requireMatchingInputs): self { + return $this->setAttribute('requireMatchingInputs', $requireMatchingInputs); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Queue.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Queue.php new file mode 100644 index 0000000..7697b0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Queue.php @@ -0,0 +1,60 @@ +setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add ReservationSid attribute. + * + * @param string $reservationSid TaskRouter Reservation SID + */ + public function setReservationSid($reservationSid): self { + return $this->setAttribute('reservationSid', $reservationSid); + } + + /** + * Add PostWorkActivitySid attribute. + * + * @param string $postWorkActivitySid TaskRouter Activity SID + */ + public function setPostWorkActivitySid($postWorkActivitySid): self { + return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Record.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Record.php new file mode 100644 index 0000000..45cbdac --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Record.php @@ -0,0 +1,132 @@ +setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Timeout to begin recording + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add FinishOnKey attribute. + * + * @param string $finishOnKey Finish recording on key + */ + public function setFinishOnKey($finishOnKey): self { + return $this->setAttribute('finishOnKey', $finishOnKey); + } + + /** + * Add MaxLength attribute. + * + * @param int $maxLength Max time to record in seconds + */ + public function setMaxLength($maxLength): self { + return $this->setAttribute('maxLength', $maxLength); + } + + /** + * Add PlayBeep attribute. + * + * @param bool $playBeep Play beep + */ + public function setPlayBeep($playBeep): self { + return $this->setAttribute('playBeep', $playBeep); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Status callback URL method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add Transcribe attribute. + * + * @param bool $transcribe Transcribe the recording + */ + public function setTranscribe($transcribe): self { + return $this->setAttribute('transcribe', $transcribe); + } + + /** + * Add TranscribeCallback attribute. + * + * @param string $transcribeCallback Transcribe callback URL + */ + public function setTranscribeCallback($transcribeCallback): self { + return $this->setAttribute('transcribeCallback', $transcribeCallback); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Redirect.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Redirect.php new file mode 100644 index 0000000..cfa3259 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Redirect.php @@ -0,0 +1,33 @@ +setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Refer.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Refer.php new file mode 100644 index 0000000..b6f8861 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Refer.php @@ -0,0 +1,51 @@ +nest(new ReferSip($sipUrl)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ReferSip.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ReferSip.php new file mode 100644 index 0000000..28ab432 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/ReferSip.php @@ -0,0 +1,23 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Reason attribute. + * + * @param string $reason Rejection reason + */ + public function setReason($reason): self { + return $this->setAttribute('reason', $reason); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Room.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Room.php new file mode 100644 index 0000000..b2de023 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Room.php @@ -0,0 +1,34 @@ +setAttribute('participantIdentity', $participantIdentity); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Say.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Say.php new file mode 100644 index 0000000..7cb1f11 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Say.php @@ -0,0 +1,158 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Voice attribute. + * + * @param string $voice Voice to use + */ + public function setVoice($voice): self { + return $this->setAttribute('voice', $voice); + } + + /** + * Add Loop attribute. + * + * @param int $loop Times to loop message + */ + public function setLoop($loop): self { + return $this->setAttribute('loop', $loop); + } + + /** + * Add Language attribute. + * + * @param string $language Message language + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sim.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sim.php new file mode 100644 index 0000000..a4ae080 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sim.php @@ -0,0 +1,23 @@ +setAttribute('username', $username); + } + + /** + * Add Password attribute. + * + * @param string $password SIP Password + */ + public function setPassword($password): self { + return $this->setAttribute('password', $password); + } + + /** + * Add Url attribute. + * + * @param string $url Action URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Status callback events + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add MachineDetection attribute. + * + * @param string $machineDetection Enable machine detection or end of greeting + * detection + */ + public function setMachineDetection($machineDetection): self { + return $this->setAttribute('machineDetection', $machineDetection); + } + + /** + * Add AmdStatusCallbackMethod attribute. + * + * @param string $amdStatusCallbackMethod HTTP Method to use with + * amd_status_callback + */ + public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { + return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); + } + + /** + * Add AmdStatusCallback attribute. + * + * @param string $amdStatusCallback The URL we should call to send amd status + * information to your application + */ + public function setAmdStatusCallback($amdStatusCallback): self { + return $this->setAttribute('amdStatusCallback', $amdStatusCallback); + } + + /** + * Add MachineDetectionTimeout attribute. + * + * @param int $machineDetectionTimeout Number of seconds to wait for machine + * detection + */ + public function setMachineDetectionTimeout($machineDetectionTimeout): self { + return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); + } + + /** + * Add MachineDetectionSpeechThreshold attribute. + * + * @param int $machineDetectionSpeechThreshold Number of milliseconds for + * measuring stick for the length + * of the speech activity + */ + public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { + return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); + } + + /** + * Add MachineDetectionSpeechEndThreshold attribute. + * + * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of + * silence after speech activity + */ + public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { + return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); + } + + /** + * Add MachineDetectionSilenceTimeout attribute. + * + * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial + * silence + */ + public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { + return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Siprec.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Siprec.php new file mode 100644 index 0000000..ac8dcc7 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Siprec.php @@ -0,0 +1,78 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Name attribute. + * + * @param string $name Friendly name given to SIPREC + */ + public function setName($name): self { + return $this->setAttribute('name', $name); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Unique name for Connector + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Track attribute. + * + * @param string $track Track to be streamed to remote service + */ + public function setTrack($track): self { + return $this->setAttribute('track', $track); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sms.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sms.php new file mode 100644 index 0000000..7209d4b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Sms.php @@ -0,0 +1,69 @@ +setAttribute('to', $to); + } + + /** + * Add From attribute. + * + * @param string $from Number to send message from + */ + public function setFrom($from): self { + return $this->setAttribute('from', $from); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlBreak.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlBreak.php new file mode 100644 index 0000000..f999cee --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlBreak.php @@ -0,0 +1,42 @@ +setAttribute('strength', $strength); + } + + /** + * Add Time attribute. + * + * @param string $time Set a pause to a specific length of time in seconds or + * milliseconds, available values: [number]s, [number]ms + */ + public function setTime($time): self { + return $this->setAttribute('time', $time); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php new file mode 100644 index 0000000..30916e6 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php @@ -0,0 +1,120 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Level attribute. + * + * @param string $level Specify the degree of emphasis + */ + public function setLevel($level): self { + return $this->setAttribute('level', $level); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlLang.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlLang.php new file mode 100644 index 0000000..91d4c0b --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlLang.php @@ -0,0 +1,140 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Xml:Lang attribute. + * + * @param string $xmlLang Specify the language + */ + public function setXmlLang($xmlLang): self { + return $this->setAttribute('xml:Lang', $xmlLang); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlP.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlP.php new file mode 100644 index 0000000..d7db4e4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlP.php @@ -0,0 +1,120 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlPhoneme.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlPhoneme.php new file mode 100644 index 0000000..b155496 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlPhoneme.php @@ -0,0 +1,42 @@ +setAttribute('alphabet', $alphabet); + } + + /** + * Add Ph attribute. + * + * @param string $ph Specifiy the phonetic symbols for pronunciation + */ + public function setPh($ph): self { + return $this->setAttribute('ph', $ph); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlProsody.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlProsody.php new file mode 100644 index 0000000..958fa0a --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlProsody.php @@ -0,0 +1,161 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Volume attribute. + * + * @param string $volume Specify the volume, available values: default, silent, + * x-soft, soft, medium, loud, x-loud, +ndB, -ndB + */ + public function setVolume($volume): self { + return $this->setAttribute('volume', $volume); + } + + /** + * Add Rate attribute. + * + * @param string $rate Specify the rate, available values: x-slow, slow, + * medium, fast, x-fast, n% + */ + public function setRate($rate): self { + return $this->setAttribute('rate', $rate); + } + + /** + * Add Pitch attribute. + * + * @param string $pitch Specify the pitch, available values: default, x-low, + * low, medium, high, x-high, +n%, -n% + */ + public function setPitch($pitch): self { + return $this->setAttribute('pitch', $pitch); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlS.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlS.php new file mode 100644 index 0000000..833e41d --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlS.php @@ -0,0 +1,110 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php new file mode 100644 index 0000000..9a4dad2 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php @@ -0,0 +1,43 @@ +setAttribute('interpret-as', $interpretAs); + } + + /** + * Add Format attribute. + * + * @param string $format Specify the format of the date when interpret-as is + * set to date + */ + public function setFormat($format): self { + return $this->setAttribute('format', $format); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSub.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSub.php new file mode 100644 index 0000000..eaf552f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlSub.php @@ -0,0 +1,34 @@ +setAttribute('alias', $alias); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlW.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlW.php new file mode 100644 index 0000000..126c6b4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/SsmlW.php @@ -0,0 +1,99 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add Role attribute. + * + * @param string $role Customize the pronunciation of words by specifying the + * word’s part of speech or alternate meaning + */ + public function setRole($role): self { + return $this->setAttribute('role', $role); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Start.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Start.php new file mode 100644 index 0000000..625d39f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Start.php @@ -0,0 +1,71 @@ +nest(new Stream($attributes)); + } + + /** + * Add Siprec child. + * + * @param array $attributes Optional attributes + * @return Siprec Child element. + */ + public function siprec($attributes = []): Siprec { + return $this->nest(new Siprec($attributes)); + } + + /** + * Add Transcription child. + * + * @param array $attributes Optional attributes + * @return Transcription Child element. + */ + public function transcription($attributes = []): Transcription { + return $this->nest(new Transcription($attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stop.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stop.php new file mode 100644 index 0000000..89f2721 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stop.php @@ -0,0 +1,51 @@ +nest(new Stream($attributes)); + } + + /** + * Add Siprec child. + * + * @param array $attributes Optional attributes + * @return Siprec Child element. + */ + public function siprec($attributes = []): Siprec { + return $this->nest(new Siprec($attributes)); + } + + /** + * Add Transcription child. + * + * @param array $attributes Optional attributes + * @return Transcription Child element. + */ + public function transcription($attributes = []): Transcription { + return $this->nest(new Transcription($attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stream.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stream.php new file mode 100644 index 0000000..2dafdbb --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Stream.php @@ -0,0 +1,87 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Name attribute. + * + * @param string $name Friendly name given to the Stream + */ + public function setName($name): self { + return $this->setAttribute('name', $name); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Unique name for Stream Connector + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Url attribute. + * + * @param string $url URL of the remote service where the Stream is routed + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Track attribute. + * + * @param string $track Track to be streamed to remote service + */ + public function setTrack($track): self { + return $this->setAttribute('track', $track); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Task.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Task.php new file mode 100644 index 0000000..2d0fae4 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Task.php @@ -0,0 +1,42 @@ +setAttribute('priority', $priority); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Timeout associated with task + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Transcription.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Transcription.php new file mode 100644 index 0000000..c231cd8 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/Transcription.php @@ -0,0 +1,162 @@ +nest(new Config($attributes)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Name attribute. + * + * @param string $name Friendly name given to the Transcription + */ + public function setName($name): self { + return $this->setAttribute('name', $name); + } + + /** + * Add Track attribute. + * + * @param string $track Track to be analyze by the provider + */ + public function setTrack($track): self { + return $this->setAttribute('track', $track); + } + + /** + * Add StatusCallbackUrl attribute. + * + * @param string $statusCallbackUrl Status Callback URL + */ + public function setStatusCallbackUrl($statusCallbackUrl): self { + return $this->setAttribute('statusCallbackUrl', $statusCallbackUrl); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add InboundTrackLabel attribute. + * + * @param string $inboundTrackLabel Friendly name given to the Inbound Track + */ + public function setInboundTrackLabel($inboundTrackLabel): self { + return $this->setAttribute('inboundTrackLabel', $inboundTrackLabel); + } + + /** + * Add OutboundTrackLabel attribute. + * + * @param string $outboundTrackLabel Friendly name given to the Outbound Track + * Label + */ + public function setOutboundTrackLabel($outboundTrackLabel): self { + return $this->setAttribute('outboundTrackLabel', $outboundTrackLabel); + } + + /** + * Add PartialResults attribute. + * + * @param bool $partialResults Indicates if partial results are going to be + * send to the customer + */ + public function setPartialResults($partialResults): self { + return $this->setAttribute('partialResults', $partialResults); + } + + /** + * Add LanguageCode attribute. + * + * @param string $languageCode Language Code used by the transcription engine + */ + public function setLanguageCode($languageCode): self { + return $this->setAttribute('languageCode', $languageCode); + } + + /** + * Add TranscriptionEngine attribute. + * + * @param string $transcriptionEngine Transcription Engine to be used + */ + public function setTranscriptionEngine($transcriptionEngine): self { + return $this->setAttribute('transcriptionEngine', $transcriptionEngine); + } + + /** + * Add ProfanityFilter attribute. + * + * @param bool $profanityFilter Enable Profanity Filter + */ + public function setProfanityFilter($profanityFilter): self { + return $this->setAttribute('profanityFilter', $profanityFilter); + } + + /** + * Add SpeechModel attribute. + * + * @param string $speechModel Speech Model used by the transcription engine + */ + public function setSpeechModel($speechModel): self { + return $this->setAttribute('speechModel', $speechModel); + } + + /** + * Add Hints attribute. + * + * @param string $hints Hints to be provided to the transcription engine + */ + public function setHints($hints): self { + return $this->setAttribute('hints', $hints); + } + + /** + * Add EnableAutomaticPunctuation attribute. + * + * @param bool $enableAutomaticPunctuation Enable Automatic Punctuation + */ + public function setEnableAutomaticPunctuation($enableAutomaticPunctuation): self { + return $this->setAttribute('enableAutomaticPunctuation', $enableAutomaticPunctuation); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/Voice/VirtualAgent.php b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/VirtualAgent.php new file mode 100644 index 0000000..9048847 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/Voice/VirtualAgent.php @@ -0,0 +1,92 @@ +nest(new Config($attributes)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Defines the conversation profile Dialogflow + * needs to use + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Language attribute. + * + * @param string $language Language to be used by Dialogflow to transcribe + * speech + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } + + /** + * Add SentimentAnalysis attribute. + * + * @param bool $sentimentAnalysis Whether sentiment analysis needs to be + * enabled or not + */ + public function setSentimentAnalysis($sentimentAnalysis): self { + return $this->setAttribute('sentimentAnalysis', $sentimentAnalysis); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback URL to post status callbacks from Twilio + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod HTTP method to use when requesting the + * status callback URL + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/TwiML/VoiceResponse.php b/vendor/twilio/sdk/src/Twilio/TwiML/VoiceResponse.php new file mode 100644 index 0000000..6cb9a05 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/TwiML/VoiceResponse.php @@ -0,0 +1,222 @@ +nest(new Voice\Connect($attributes)); + } + + /** + * Add Dial child. + * + * @param string $number Phone number to dial + * @param array $attributes Optional attributes + * @return Voice\Dial Child element. + */ + public function dial($number = null, $attributes = []): Voice\Dial { + return $this->nest(new Voice\Dial($number, $attributes)); + } + + /** + * Add Echo child. + * + * @return Voice\Echo_ Child element. + */ + public function echo_(): Voice\Echo_ { + return $this->nest(new Voice\Echo_()); + } + + /** + * Add Enqueue child. + * + * @param string $name Friendly name + * @param array $attributes Optional attributes + * @return Voice\Enqueue Child element. + */ + public function enqueue($name = null, $attributes = []): Voice\Enqueue { + return $this->nest(new Voice\Enqueue($name, $attributes)); + } + + /** + * Add Gather child. + * + * @param array $attributes Optional attributes + * @return Voice\Gather Child element. + */ + public function gather($attributes = []): Voice\Gather { + return $this->nest(new Voice\Gather($attributes)); + } + + /** + * Add Hangup child. + * + * @return Voice\Hangup Child element. + */ + public function hangup(): Voice\Hangup { + return $this->nest(new Voice\Hangup()); + } + + /** + * Add Leave child. + * + * @return Voice\Leave Child element. + */ + public function leave(): Voice\Leave { + return $this->nest(new Voice\Leave()); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Voice\Pause Child element. + */ + public function pause($attributes = []): Voice\Pause { + return $this->nest(new Voice\Pause($attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Voice\Play Child element. + */ + public function play($url = null, $attributes = []): Voice\Play { + return $this->nest(new Voice\Play($url, $attributes)); + } + + /** + * Add Queue child. + * + * @param string $name Queue name + * @param array $attributes Optional attributes + * @return Voice\Queue Child element. + */ + public function queue($name, $attributes = []): Voice\Queue { + return $this->nest(new Voice\Queue($name, $attributes)); + } + + /** + * Add Record child. + * + * @param array $attributes Optional attributes + * @return Voice\Record Child element. + */ + public function record($attributes = []): Voice\Record { + return $this->nest(new Voice\Record($attributes)); + } + + /** + * Add Redirect child. + * + * @param string $url Redirect URL + * @param array $attributes Optional attributes + * @return Voice\Redirect Child element. + */ + public function redirect($url, $attributes = []): Voice\Redirect { + return $this->nest(new Voice\Redirect($url, $attributes)); + } + + /** + * Add Reject child. + * + * @param array $attributes Optional attributes + * @return Voice\Reject Child element. + */ + public function reject($attributes = []): Voice\Reject { + return $this->nest(new Voice\Reject($attributes)); + } + + /** + * Add Say child. + * + * @param string $message Message to say + * @param array $attributes Optional attributes + * @return Voice\Say Child element. + */ + public function say($message, $attributes = []): Voice\Say { + return $this->nest(new Voice\Say($message, $attributes)); + } + + /** + * Add Sms child. + * + * @param string $message Message body + * @param array $attributes Optional attributes + * @return Voice\Sms Child element. + */ + public function sms($message, $attributes = []): Voice\Sms { + return $this->nest(new Voice\Sms($message, $attributes)); + } + + /** + * Add Pay child. + * + * @param array $attributes Optional attributes + * @return Voice\Pay Child element. + */ + public function pay($attributes = []): Voice\Pay { + return $this->nest(new Voice\Pay($attributes)); + } + + /** + * Add Prompt child. + * + * @param array $attributes Optional attributes + * @return Voice\Prompt Child element. + */ + public function prompt($attributes = []): Voice\Prompt { + return $this->nest(new Voice\Prompt($attributes)); + } + + /** + * Add Start child. + * + * @param array $attributes Optional attributes + * @return Voice\Start Child element. + */ + public function start($attributes = []): Voice\Start { + return $this->nest(new Voice\Start($attributes)); + } + + /** + * Add Stop child. + * + * @return Voice\Stop Child element. + */ + public function stop(): Voice\Stop { + return $this->nest(new Voice\Stop()); + } + + /** + * Add Refer child. + * + * @param array $attributes Optional attributes + * @return Voice\Refer Child element. + */ + public function refer($attributes = []): Voice\Refer { + return $this->nest(new Voice\Refer($attributes)); + } +} \ No newline at end of file diff --git a/vendor/twilio/sdk/src/Twilio/Values.php b/vendor/twilio/sdk/src/Twilio/Values.php new file mode 100644 index 0000000..7d6ba96 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Values.php @@ -0,0 +1,98 @@ + $value) { + if (!in_array($value, self::$noneConstants, true)) { + $result[$key] = $value; + } + } + return $result; + } + + public function __construct(array $options) { + $this->options = []; + foreach ($options as $key => $value) { + $this->options[\strtolower($key)] = $value; + } + } + + /** + * (PHP 5 >= 5.0.0)
+ * Whether a offset exists + * @link http://php.net/manual/en/arrayaccess.offsetexists.php + * @param mixed $offset

+ * An offset to check for. + *

+ * @return bool true on success or false on failure. + *

+ *

+ * The return value will be casted to boolean if non-boolean was returned. + */ + public function offsetExists($offset): bool { + return true; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to retrieve + * @link http://php.net/manual/en/arrayaccess.offsetget.php + * @param mixed $offset

+ * The offset to retrieve. + *

+ * @return mixed Can return all value types. + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) { + $offset = \strtolower($offset); + return \array_key_exists($offset, $this->options) ? $this->options[$offset] : self::NONE; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to set + * @link http://php.net/manual/en/arrayaccess.offsetset.php + * @param mixed $offset

+ * The offset to assign the value to. + *

+ * @param mixed $value

+ * The value to set. + *

+ * @return void + */ + public function offsetSet($offset, $value): void { + $this->options[\strtolower($offset)] = $value; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to unset + * @link http://php.net/manual/en/arrayaccess.offsetunset.php + * @param mixed $offset

+ * The offset to unset. + *

+ * @return void + */ + public function offsetUnset($offset): void { + unset($this->options[$offset]); + } +} diff --git a/vendor/twilio/sdk/src/Twilio/Version.php b/vendor/twilio/sdk/src/Twilio/Version.php new file mode 100644 index 0000000..d0ede2f --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/Version.php @@ -0,0 +1,236 @@ +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(string $uri): string { + 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(string $uri): string { + return \trim($this->version ?? '', '/') . '/' . \trim($uri, '/'); + } + + public function request(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): Response { + $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 $response, string $header): TwilioException { + $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(); + $moreInfo = $content['more_info'] ?? ''; + $details = $content['details'] ?? []; + return new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); + } + + return new RestException($message, $response->getStatusCode(), $response->getStatusCode()); + } + + /** + * @throws TwilioException + */ + public function fetch(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null) { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + // 3XX response codes are allowed here to allow for 307 redirect from Deactivations API. + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 400) { + throw $this->exception($response, 'Unable to fetch record'); + } + + return $response->getContent(); + } + + /** + * @throws TwilioException + */ + public function update(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null) { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { + throw $this->exception($response, 'Unable to update record'); + } + + return $response->getContent(); + } + + /** + * @throws TwilioException + */ + public function delete(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): bool { + $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(int $limit = null, int $pageSize = null): array { + if ($limit && $pageSize === null) { + $pageSize = $limit; + } + + $pageSize = \min($pageSize, self::MAX_PAGE_SIZE); + + return [ + 'limit' => $limit ?: Values::NONE, + 'pageSize' => $pageSize ?: Values::NONE, + 'pageLimit' => Values::NONE, + ]; + } + + public function page(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): Response { + return $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + } + + public function stream(Page $page, $limit = null, $pageLimit = null): Stream { + return new Stream($page, $limit, $pageLimit); + } + + /** + * @throws TwilioException + */ + public function create(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $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(); + } + + public function getDomain(): Domain { + return $this->domain; + } + + public function __toString(): string { + return '[Version]'; + } +} diff --git a/vendor/twilio/sdk/src/Twilio/VersionInfo.php b/vendor/twilio/sdk/src/Twilio/VersionInfo.php new file mode 100644 index 0000000..fe61231 --- /dev/null +++ b/vendor/twilio/sdk/src/Twilio/VersionInfo.php @@ -0,0 +1,15 @@ +. + */ + +/** + * 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 + * @author Roman S. Borschel + * @author Matthew Weier O'Phinney + * @author Kris Wallsmith + * @author Fabien Potencier + */ +class SplClassLoader { + private $_fileExtension = '.php'; + private $_namespace; + private $_includePath; + private $_namespaceSeparator = '\\'; + + /** + * Creates a new SplClassLoader 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): void { + $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(): string { + 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): void { + $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(): string { + return $this->_includePath; + } + + /** + * Sets the file extension of class files in the namespace of this class loader. + * + * @param string $fileExtension + */ + public function setFileExtension($fileExtension): void { + $this->_fileExtension = $fileExtension; + } + + /** + * Gets the file extension of class files in the namespace of this class loader. + * + * @return string $fileExtension + */ + public function getFileExtension(): string { + return $this->_fileExtension; + } + + /** + * Installs this class loader on the SPL autoload stack. + */ + public function register(): void { + \spl_autoload_register([$this, 'loadClass']); + } + + /** + * Uninstalls this class loader from the SPL autoloader stack. + */ + public function unregister(): void { + \spl_autoload_unregister([$this, 'loadClass']); + } + + /** + * Loads the given class or interface. + * + * @param string $className The name of the class to load. + * @return void + */ + public function loadClass($className): void { + 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();